2014-06-05 97 views
0

我正在尝试开发一个最终将包含ChartJS的小工具,但由于它没有加载,所以我遇到了默认小工具的问题。Jira小工具不能正常工作

我把到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="[email protected]" 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

+0

是否JIRA日志显示在您上传的模块时什么?通常,如果插件在上传时被禁用,JIRA会在JIRA_HOME/logs/catalina.out和/或JIRA_DATA/log/atlassian-jira.log中上传时在日志文件*中提出某种投诉。另外,我看到您的atlassian-plugins.xml中'gadget'元素的'location =“/ gadget.xml”'部分中有一个前导斜杠。您可以尝试删除斜线以查看会发生什么。 (我们从来没有在我们的插件描述中使用前导斜杠,但我不记得它是否可以选择包含或不包含)。 –

+0

@ScottDudley hi Sott,我得到这个错误:插件处于无效状态,DIS ABLED ,不支持转换为启用。最有可能的是,它由于超时而被禁用。 –

+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"/>