Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

OSGi bundles listed as dependencies in pom.xml cannot be resolved

Charles Duffy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2012

Howdy --

I have some 3rd-party dependencies in my pom.xml which are packaged as OSGi bundles and listed in my atlassian-plugin.xml under the Import-Packages section (to allow runtime, reflective use of the classes in these packages, as otherwise only the classes from these bundles which are directly loaded are available). However, when I first try to invoke my plugin via "atlas-mvn jira:run", I receive a BundleException ("Unresolved constraint", claiming that that dependency is unavailable).

How can this be resolved in a way which allows reflective use?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Charles Duffy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2012

The inability to use classes reflectively at runtime is not a desired feature, but rather, a result of the wrong classloader being in use -- as detailed in a different question, Wrong BundleDelegatingClassLoader in use during plugin runtime.


Until this issue is resolved, calling Thread.currentThread().setContextClassLoader(this.class.getClassLoader()) serves as a workaround.

TAGS
AUG Leaders

Atlassian Community Events