On 2008-11-18, Petar Tahchiev <[EMAIL PROTECTED]> wrote:

> I was trying to move Cargo to be built by Gump, but it seems
> I am facing some problems. I have declared Ant as a dependency:

>     <depend project="ant" inherit="runtime"/>

> but the execution fails with a NoClassDefFound error on AntMain, which is
> supposed to reside in ant-launcher:

and probably is there (since the projects building with Ant work).

You can see the jar on the CLASSPATH, but I'm afraid Maven is not
using it when starting Ant.

Looking at the stack trace things look pretty convoluted.  This is
Maven's surefire plugin running JUnit which starts Cargo which tries
to run Ant.  In this setup it is very hard to tell which Classloader
may be playing up.

My best guess right now is that Surefire includes ant.jar in your test
classpath but not ant-optional.jar.  Line 312 in Ant's Project class
in trunk is

        setPropertyInternal(MagicNames.ANT_VERSION, Main.getAntVersion());

which causes thr Main class to be loaded which in turn implements
AntMain which requires ant-launcher.jar.  This has been true in Ant
1.7.1 as well.

Having looked at
http://svn.codehaus.org/cargo/core/trunk/api/container/pom.xml (just
guessing) I see a dependency on ant.jar but none on ant-launcher.jar,
I think you need both, at least with Ant 1.7.1 and later.


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to