This is not allowed when Atlassian-Plugin-Key is set

Thanks for your attention.

I installed Atlassian SDK 6.2.9, and created a JIRA custom plugin with AO component import.

But JIRA can not run successfully with the command ‘atlas-run’,throwing an Error in the log, which is
atlassian-plugin.xml contains a definition of component-import.This is not allowed when Atlassian-Plugin-Key is set.

So how can I inject active object?

You can use the spring scanner annotations. Check out

1 Like

Just to clarify: When you add a “Atlassian-Plugin-Key” to your pom, you’re explicitly enabling the Spring Scanner. This is 100% incompatible with the older method.

Either use <component-import> or enable Spring Scanner + annotations: You cannot use both.

1 Like
  • Delete <component-import> from atlassian-plugin.xml

  • Wherever you use imported component create constructor (or add to exiting constructor) @ComponentImport and @Inject (or Autowired) like below

    public ExposeToOSGIComponent(@ComponentImport final IssueService issueService,final InternalComponent internalComponent)
        this.issueService = issueService;
        this.internalComponent = internalComponent;
1 Like