Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Spring Scanner 2: How to import old-style <component> from maven dependency

Amyn Bennamane June 2, 2019

I'm trying to import "Yet Another Commit Checker" plugin v1.24, as follows in my POM:

<!-- in project dependencies -->
<dependency>
<groupId>com.isroot.stash.plugin</groupId>
<artifactId>yacc</artifactId>
<version>1.24</version>
</dependency>

<!-- in bitbucket-maven-plugin configuration-->
<Import-Package>*, com.isroot.stash.plugin, com.isroot.stash.plugin.jira</Import-Package>

 

However that plugin declares its spring components as follows:

<component key="jiraService" class="com.isroot.stash.plugin.jira.JiraServiceImpl" public="true">
<interface>
com.isroot.stash.plugin.JiraService</interface>
</component>

 

And so my plugin log is telling me it can't find the package: 

[INFO] 2019-06-02 22:36:35,022 ERROR [QuickReload - Plugin Installer] c.a.plugin.osgi.factory.OsgiPlugin Detected an error (BundleException) enabling the plugin 'com.amyn.bitbucket.plugin.fix.version.fix-version-plugin' : Unresolved constraint in bundle com.amyn.bitbucket.plugin.fix.version.fix-version-plugin [149]: Unable to resolve 149.0: missing requirement [149.0] osgi.wiring.package; (&(osgi.wiring.package=com.isroot.stash.plugin)). This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN

Nothing in https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/ says that you can't import packages from maven dependencies that export their components the old way, i.e with <component> declarations. Any idea what I could be doing wrong here?

I tried adding a version=0 clause in the <Import-Package> instruction, but that didn't help.

Thanks,

 

EDIT: This seems to be the same question as https://community.atlassian.com/t5/Answers-Developer-Questions/Import-Package-of-plugin-bundled-jar-leads-to-org-osgi-framework/qaq-p/508683 -- but then my question would be how to import those dependencies?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events