Atlassian-plugin.xml contains the definition of the component-import. This is prohibited if Atlassian-Plugin-Key is installed.

This is what I get when I run atlas-create-jira-plugin and then atlas-create-jira-plugin-module selects option 1: Component Import .

The problem is that all the tutorial examples seem to have a plugin descriptor generated by the old version of the SDK (which will not be deployed with newer versions of the SDK / Jira at all) that do not contain the Atlassian-Plugin-Key , so I cannot find The way to import the component.

I am using SDK 6.2.3 and Jira 7.1.1.

Any hint - how to sort it?

+6
source share
3 answers

Found the answer here: https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins

It seems like I was somehow missing that the Atlassian-Plugin-Key can be omitted, and this needs to be done when you need to import components.

This key simply tells spring not to convert the spring plugin configuration, which should happen as part of the component import process.

+4
source

anonymous. The old way to do things was to put the <component-import> in your atlassian-plugin.xml . A new way, and it is also recommended to use the Atlassian Spring Scanner . When you create an add-in using atlas-jira-create-plugin , and your pom.xml has the <Atlassian-Plugin-Key> and the atlassian-spring-scanner-annotation and atlassian-spring-scanner-runtime dependencies, then you use the new way.

If you have two dependencies, you are using Atlassian Spring Scanner version 1.x. If you only have atlassian-spring-scanner-annotation , you are using version 2.x.

You do not need to skip / comment on Atlassian-Plugin-Key in pom.xml , and you do not need to embed component-import in atlassian-plugin.xml .

For example, you want to add a license for your add-on and import the PluginLicenseManager component. You just go straight to the code, and your constructor might look like this:

 @Autowired public MyMacro(@ComponentImport PluginLicenseManager licenseManager) { this.licenseManager = licenseManager; } 

And your class looks like this:

 @Scanned public class MyMacro implements Macro { 

If memory suits me, be sure to check for null , because sometimes the Atlassian Spring Scanner cannot insert a component. I think in version 1, by writing @EventListener , he was unable to enter a ConversionContext . But when writing the macro, he was able to introduce a ConversionContext .

+3
source

According to https://bitbucket.org/atlassian/atlassian-spring-scanner

component-import not required. You can replace it with @ComponentImport annotation in your Java.

+2
source

All Articles