【问题标题】:Jira gadget is not workingJira 小工具不工作
【发布时间】:2014-06-05 14:18:52
【问题描述】:

我正在尝试开发一个最终将包含 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复制的

但我还是得到了

【问题讨论】:

  • 在您上传模块时,JIRA 日志是否显示任何内容?通常,如果插件在上传时被禁用,JIRA 会在日志文件在上传时在 JIRA_HOME/logs/catalina.out 和/或 JIRA_DATA/log/atlassian -jira.log。另外,我看到您的 atlassian-plugins.xml 中 gadget 元素的 location="/gadget.xml" 部分有一个前导斜杠。您可以尝试删除斜线以查看会发生什么。 (我们从不在插件描述中使用前导斜杠,但我不记得是否可以选择包含它。)
  • @ScottDudley 嗨 Sott,我收到此错误:插件处于无效状态,禁用,不支持转换为启用。很可能是由于超时而被禁用。
  • 在此之前是否有任何错误?如果将鼠标悬停在该行上并单击“启用”,然后再次检查状态(和日志)会发生什么?听起来该插件可能由于某种原因在之前的上传中被禁用,使其处于禁用状态,并且上传新版本不会自动启用它。
  • 告诉我模块不能被修改lol
  • 当您尝试禁用和重新启用整个插件时,日志中是否有任何内容?另外,我无法判断屏幕截图中的“禁用”模块是否实际上是指您的 因为名称不匹配。您能否编辑您的帖子以包含整个 atlassian-plugin.xml?

标签: jira jira-plugin


【解决方案1】:

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

改变这个:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-26
    • 2015-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多