Confluence - Atlassian ::两个自己开发的插件相互阻塞

时间:2014-07-02 13:06:48

标签: confluence xwork

我为Confluence开发了两个插件。 当我只安装其中一个时,一切都按预期工作。但是当两者都安装完毕并且我想访问其中一个的配置URL时,会出现错误"找不到页面"。

以下是2个atlassin-plugin.xml文件:

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
  <plugin-info>
    <description>${project.description}</description>
    <version>${project.version}</version>
    <vendor name="${project.organization.name}" url="${project.organization.url}"/>
    <param name="plugin-icon">images/pluginIcon.png</param>
    <param name="plugin-logo">images/pluginLogo.png</param>
    <param name="configure.url">/admin/plugins/report/configuration.action</param>
  </plugin-info>

  <resource type="i18n" name="i18n" location="/i18n/report"/>


  <web-resource key="report-page-resources" name="Report page Web Resources">
    <resource type="download" name="report.js" location="js/report.js"/>
    <resource type="download" name="melden.css" location="css/melden.css"/>
    <resource type="download" name="load_cats.gif" location="images/load_cats.gif"/>
    <dependency>confluence.web.resources:ajs</dependency>
    <context>atl.general</context>
  </web-resource>

  <web-item key="report-button" name="Report Button" section="system.content.action/marker" weight="40">
    <label key="de.essendi.confluence.report.label"/>
    <styleClass>reportButton</styleClass>
    <link>/</link>
  </web-item>
  <xwork name="Report Admin Configuration" key="melden-admin-configuration-action">
    <package name="configuration" extends="default" namespace="/admin/plugins/report">
      <default-interceptor-ref name="defaultStack"/>
      <action name="configuration" class="de.essendi.confluence.report.admin.action.ConfigureActionReport">
        <result name="success" type="velocity">/templates/melden-configurationaction.vm</result>
      </action>
      <action name="submit" class="de.essendi.confluence.report.admin.action.SubmitActionReport">
        <result name="success" type="redirect">/admin/plugins/report/configuration.action</result>
      </action>
    </package>
  </xwork>
  <rest key="report-rest" path="/report" version="1.0">
    <description>Provides the Report REST Api.</description>
    <package>de.essendi.confluence.report.rest</package>
  </rest>
  <component key="report-settings-manager" class="de.essendi.confluence.report.admin.DefaultReportSettingsManager" interface="de.essendi.confluence.report.admin.ReportSettingsManager"/>
  <!-- import from the product container -->
  <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties"/>

  <component key="report-mail-service-impl" class="de.essendi.confluence.report.email.MailServiceImpl" name="Mail Service Impl" i18n-name-key="mail-service-impl.name">
    <description key="mail-service-impl.description">The Mail Service Impl Plugin</description>
    <interface>de.essendi.confluence.report.email.MailService</interface>
  </component>

 <component-import key="i18nResolver" interface="com.atlassian.sal.api.message.I18nResolver"/>
  <component-import key="task-manager" interface="com.atlassian.core.task.MultiQueueTaskManager" filter=""/>
</atlassian-plugin>

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
  <plugin-info>
    <description>${project.description}</description>
    <version>${project.version}</version>
    <vendor name="${project.organization.name}" url="${project.organization.url}"/>
    <param name="plugin-icon">images/pluginIcon.png</param>
    <param name="plugin-logo">images/pluginLogo.png</param>
    <param name="configure.url">/admin/plugins/groupfilter/configuration.action</param>
  </plugin-info>
  <!-- add our i18n resource -->
  <resource type="i18n" name="i18n" location="groupFilter"/>
  <!-- add our web resources -->
  <web-resource key="groupFilter-resources" name="groupFilter Web Resources">
    <dependency>com.atlassian.auiplugin:ajs</dependency>
    <resource type="download" name="groupFilter.css" location="/css/groupFilter.css"/>
    <resource type="download" name="groupFilter.js" location="/js/groupFilter.js"/>
    <resource type="download" name="images/" location="/images"/>
    <context>groupFilter</context>
  </web-resource>

  <xwork name="Groupfilter Admin Configuration" key="groupfilter-admin-configuration-action">
    <package name="configuration" extends="default" namespace="/admin/plugins/groupfilter">
      <default-interceptor-ref name="defaultStack"/>
      <action name="configuration" class="de.essendi.confluence.groupFilter.admin.action.ConfigurationAction">
        <result name="success" type="velocity">/templates/groupfilter-configurationaction.vm</result>
      </action>
      <action name="submit" class="de.essendi.confluence.groupFilter.admin.action.SubmitAction">
        <result name="success" type="redirect">/admin/plugins/groupfilter/configuration.action</result>
      </action>
    </package>
  </xwork>

   <component name="LDAP Sync Listener" class="de.essendi.confluence.groupFilter.SyncEvent" key="groupfilter-syncevent-listener"/>
  <!-- import from the product container -->
  <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties"/>
  <component key="group-filter-manger-impl" class="de.essendi.confluence.groupFilter.admin.GroupFilterMangerImpl" name="Group Filter Manger Impl" i18n-name-key="group-filter-manger-impl.name">
    <description key="group-filter-manger-impl.description">The Group Filter Manger Impl Plugin</description>
    <interface>de.essendi.confluence.groupFilter.admin.GroupFilterManager</interface>
  </component>
</atlassian-plugin>

感谢您的帮助

2 个答案:

答案 0 :(得分:0)

key =“$ {project.groupId}。$ {project.artifactId}”表示插件标识符取自maven的pom.xml。你确定pom.xml中的groupId和/或artifactId是不同的吗?

此外,转到附加列表并检查两个插件是否真正列在那里以及它们的密钥是什么。

答案 1 :(得分:0)

确保xwork元素中的包名称是唯一的。在您的示例中,这两个包都称为 name =“configuration”。这导致只有最后一个启用的包处于活动状态。