Hi community,
I have developed two plugins for Jira (indexing- and identity-connector for a 3p system) and each one of them by itself is working totally fine. However when I try to run them both in a single Jira Application, the one that was installed latest does not work.
The installation is completed without an error, but when I try to access the admin-UI of the plugin (both are using webwork), the UI of the latest plugin does not load because the Action I am using cannot be created due to missing bean references. The following error is logged, where the < * > is a substitute for either âindexingâ or âidentityâ, depending on which plugin is not working:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name âde.twt.atlassian.jira.gcs.< * >.administration.action.DefaultActionâ: Unsatisfied dependency expressed through constructor argument with index 0 of type [de.twt.atlassian.jira.gcs.< * >.configuration.Configuration]: No qualifying bean of type [de.twt.atlassian.jira.gcs.< * >.configuration.Configuration] found for dependency
Both plugins are using a âDefaultActionâ-class which is located in different packages (âde.twt.atlassian.jira.gcs.identity.administration.actionâ and âde.twt.atlassian.jira.gcs.indexing.administration.actionâ). In these actions a âConfigurationâ bean is injected:
@Inject
public DefaultAction(final Configuration configuration) {
this.configuration = configuration;
}
The âConfigurationâ is an interface with an implementing class at distinct packages âde.twt.atlassian.jira.gcs.identity.configuration.base.DefaultConfigurationâ and âde.twt.atlassian.jira.gcs.indexing.configuration.base.DefaultConfigurationâ. It is annoted as â@Namedâ and has the following constructor:
@Inject
public DefaultConfiguration(@ComponentImport final PluginSettingsFactory pluginSettingsFactory) {
pluginSettings = pluginSettingsFactory.createSettingsForKey(this.getClass().getName());
}
I have tried to rename the âConfigurationâ for the âindexingâ Plugin to âIndexingConfigurationâ to avoid naming issues, but still get the error. I have also tried annotating the âConfigurationâ-Bean with â@Qualifierâ and a unique name, but still get the âno-bean-foundâ error. To me it seems that spring only works for the plugin which is installed first, and it fails for the other one.
I have absolutely no clue why this happens and cannot find anything regarding this issue on the internet. I have made sure that the package-name, the plugin-key and all keys in the âatlassian-plugin.xmlâ are unique between these plugins.
These are the configurations of the jira-maven-plugin:
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jira-maven-plugin</artifactId>
<version>8.0.0</version>
<extensions>true</extensions>
<configuration>
<productVersion>7.4.2</productVersion>
<productDataVersion>7.4.2</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<instructions>
<Atlassian-Plugin-Key>de.twt.atlassian.jira.twt-gcs-jira-< * >-connector</Atlassian-Plugin-Key>
<Import-Package>
*;version="0";resolution:=optional
</Import-Package>
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
Substitute â< * >â with âindexingâ or âidentityâ.
Again, please note that both plugins are working totally fine when I only install one of them. Only when I install both of them, the one I installed latest is producing the above error.
Any ideas on what I might be doing wrong or missing?
Best regards