In a plugin I'm developing I depend on nexus-maven-bridge-plugin-2.6.2-01. I make use of maven-model-3.0.5 (by transitive dependency from nexus-maven-bridge-plugin), but at runtime I get a class loader error:
java.lang.LinkageError: loader constraint violation: loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) previously initiated loading for a different type with name "org/apache/maven/model/Repository"
Doing a search in my nexus app directory I get:
maci:nexus-current greg$ find . |grep maven-model-3
So, a jar that is available from WEB-INF/lib is also included in several plugins. Is this correct behavior?
I could make the class loader exception go away by patching nexus-maven-bridge-plugin-2.6.2-01.jar and adding shared=true to its nexus plugin.xml as so:
Is this a bug or am I doing something wrong?
1) maven-model is sadly in core as long as maven support is in core, is needed there
2) the other copies of model (indexer and restlet1x) are strictly private uses of it, and having them in there is okay (they do not leak out, today they just "waste" some space)
3) yes, you patch is correct, the maven bridge plugin should be sharing model dependency, as the bridge API contains classes from it (similar problem as Indexer had)
Pull requests welcome!
On Mon, Oct 7, 2013 at 4:17 PM, Gergely Nagy <[hidden email]> wrote:
In a plugin I'm developing I depend on nexus-maven-bridge-plugin-2.6.2-01. I
BTW, this should no longer be the case on master, forget when this was changed but I think it must have been post 2.6. The nexus-bundle-maven-plugin will now automatically _ban_ dependencies were are provided by nexus-plugin-api (ie. stuff in core).
On October 7, 2013 at 7:40:10 AM, Tamás Cservenák ([hidden email]) wrote:
|Free forum by Nabble||Edit this page|