Jira小工具无法使用

时间:2014-06-05 14:18:52

标签: jira jira-plugin

我正在尝试开发一个最终会包含ChartJS的小工具,但我遇到了默认小工具的问题,因为它没有加载。

我在attlassian-plugin.xml中输入的代码如下:

<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>
    </plugin-info>

    <!-- add our i18n resource -->
    <resource type="i18n" name="i18n" location="report"/>

    <!-- add our web resources -->
    <web-resource key="report-resources" name="report Web Resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>

        <resource type="download" name="report.css" location="/css/report.css"/>
        <resource type="download" name="report.js" location="/js/report.js"/>
        <resource type="download" name="images/" location="/images"/>

        <context>report</context>
    </web-resource>

    <!-- publish our component -->
    <component key="myPluginComponent" class="com.wfs.report.MyPluginComponentImpl" public="true">
        <interface>com.wfs.report.MyPluginComponent</interface>
    </component>

    <!-- import from the product container -->
    <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />

<webwork1 key="demoaction" name="JTricks Demo Action" class="java.lang.Object">
  <actions>
    <action name="com.wfs.report.DemoAction" alias="DemoAction">
      <view name="input">/templates/input.vm</view>
      <view name="success">/templates/joy.vm</view>
      <view name="error">/templates/tears.vm</view>
    </action>
  </actions>
</webwork1>

<atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
  <plugin-info>
    <description>A basic gadget module</description>
    <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
    <version>1.0</version>
  </plugin-info>

  <gadget key="unique-gadget-key" location="gadget.xml"/>

</atlassian-plugin>
</atlassian-plugin>

我放在资源目录中的gadget.xml是:

   <?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="JIRA Issues" author_email="adent@example.com" directory_title="JIRA Issues"
      screenshot="images/screenshot.png"
      thumbnail="images/thumbnail.png">
    <Optional feature="dynamic-height" />
  </ModulePrefs>

  <Content type="html">
     <![CDATA[ 
       Hello, world!
     ]]>
   </Content> 
</Module>
</xml>
我从https://developer.atlassian.com/display/GADGETS/Creating+your+Gadget+XML+Specification

复制的

但我还是得到了

enter image description here

1 个答案:

答案 0 :(得分:3)

看起来你有一个插件描述符嵌套在另一个插件描述符中。 (我很惊讶它确实通过了验证!)

改变这个:

<atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
  <plugin-info>
    <description>A basic gadget module</description>
    <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
    <version>1.0</version>
  </plugin-info>

  <gadget key="unique-gadget-key" location="gadget.xml"/>

</atlassian-plugin>

就是这样:

  <gadget key="unique-gadget-key" location="gadget.xml"/>