On 1-May-09, at 12:30 PM, Paul Gier wrote:
The maven ant tasks currently creates a shaded jar that combines
several of the dependencies into one jar. While working on
MANTTASKS-106 (using ant tasks inside ant-run) I noticed that the
plexus utils classes are relocated to hidden.org.plexus.utils.
This causes classloader problems when calling the ant tasks inside
ant run. For example using maven 2.0.10 I get the following:
Caused by: java.lang.LinkageError: loader constraints violated when
linking hidden/org/codehaus/plexus/interpolation/ValueSource class
at
org
.apache
.maven
.artifact
.ant.AbstractArtifactTask.readSettings(AbstractArtifactTask.java:361)
If I remove the <relocations> config so that plexus utils are not
renamed in the jar, then MANTTASKS-106 is resolved, and the unit
tests for the various tasks still work fine. I tested with maven
2.0.6, 2.0.10, and 2.1.0 and all seem to work ok.
Anyone know why the relocation config was added or any reason why I
shouldn't remove it?
I don't think the tests are very comprehensive, but provided the Ant
Task uber JAR is on the classpath first they will get loaded first,
but this means that the version of Plexus Utils required by the Maven
if used as part of the Ant tasks will also use those . So it's your
use case of having the Ant task being used inside the Ant Run plugin
that has the most probability of not working. For stand-alone this is
probably not going to be a problem except for when your project uses
plexus-utils because the version the Ant Tasks users will be forced on
everything.
That error above, you sure you're not pulling in two shaded versions?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/SonatypeNexus
http://twitter.com/SonatypeM2E
----------------------------------------------------------
In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
-- Jacques Ellul, The Technological Society
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]