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 [EMAIL PROTECTED] OpenPGP key available from: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7977F79C
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
