atlassian-plugin.xml包含component-import的定义。当设置Atlassian-Plugin-Key时,这是不允许的。

10
当我运行atlas-create-jira-plugin接着运行atlas-create-jira-plugin-module并选择选项1: Component Import时,出现了这个问题。
问题在于所有的教程示例似乎都有旧版SDK生成的插件描述符(无法与更新版本的SDK / Jira一起部署),不包含Atlassian-Plugin-Key,因此我找不到导入组件的方法。
我正在使用SDK 6.2.3和Jira 7.1.1。
有什么提示可以解决这个问题吗?
3个回答

8
匿名用户说得对。以前的做法是在你的atlassian-plugin.xml中放置标签。新的方式也是推荐使用Atlassian Spring Scanner。当你使用atlas-jira-create-plugin创建插件并且你的pom.xml<Atlassian-Plugin-Key>标签和依赖项atlassian-spring-scanner-annotationatlassian-spring-scanner-runtime时,你就在使用新的方式。
如果你同时拥有这两个依赖项,那么你就在使用Atlassian Spring Scanner 1.x版本。如果你只有atlassian-spring-scanner-annotation,那么你就在使用2.x版本。
你不必在pom.xml中省略/注释掉Atlassian-Plugin-Key,也不必在atlassian-plugin.xml中放置component-import
例如,你想为你的插件添加许可证并需要导入组件PluginLicenseManager,你只需直接进入代码,你的构造函数可能看起来像这样:
@Autowired
public MyMacro(@ComponentImport PluginLicenseManager licenseManager) {
    this.licenseManager = licenseManager;
}

您的类应该像这样:

@Scanned
public class MyMacro implements Macro {

如果我的记忆没有错的话,请务必检查null,因为有时Atlassian Spring Scanner无法注入组件。我想在版本1上编写@EventListener时,它无法注入ConversionContext。但是在编写宏时,它能够注入ConversionContext

5

4

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接