You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ben Anderson <be...@benanderson.us> on 2004/10/20 21:11:53 UTC
[RES} Re: running the project out of maven.xml
what do you know - that worked! Thanks Craig!
Craig S. Cottingham wrote:
> On Oct 20, 2004, at 13:24, Ben Anderson wrote:
>
>> I'd like to take advantage of the classpath which maven uses to run
>> my project. I've tried to solutions:
>> [ ... ]
>> 2. <ant:java classname="us.benanderson.rpc.Assignment3"
>> classpath="${basedir}/target/classes"
>> classpathref="maven.dependency.classpath"/>
>>
>> This makes a little more sense, but for some reason I'm getting this
>> output:
>>
>> [java] [ERROR] java.lang.NoClassDefFoundError: org/w3c/dom/Document
>
>
> Oh so close. Try adding 'fork="true"' to the ant:java tag.
>
> It's possible to make a goal that's pretty flexible. For instance,
> here's what I use:
>
> <goal name="run" prereqs="java:compile,java:jar-resources">
> <ant:java classname="${classname}" fork="true">
> <ant:classpath>
> <ant:path refid="maven.dependency.classpath" />
> <ant:pathelement path="${maven.build.dest}" />
> </ant:classpath>
> </ant:java>
> </goal>
>
> This requires defining "classname" on the command line, like:
>
> maven -Dclassname=net.cottingham.Test run
>
> --
> Craig S. Cottingham
> craig@cottingham.net
> OpenPGP key available from:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7977F79C
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org