Blame ant :)

You'll need to fork to get this to work at the moment.

- Brett

> -----Original Message-----
> From: Andy Jefferson [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, 21 January 2004 2:17 AM
> To: [EMAIL PROTECTED]
> Subject: Classloading
> 
> 
> I've added a custom goal that runs "ant:java" ... as follows
> 
>         <path id="myclasspath">
>             <path refid="maven.dependency.classpath"/>
>             <pathelement path="${maven.build.dest}"/>
>         </path>
> 
>         <ant:java dir="${basedir}/target/classes"
>             classname="mydomain.Main"
>             failonerror="true"
>             fork="false">
>             <classpath refid="myclasspath"/>
>         </ant:java>
> 
> The "mydomain.Main" class operates using standard input and 
> standard output, 
> extracting responses from the user and writing to stdout. If I use 
> fork="true" then it fails because stdin/stdout aren't 
> available in the usual 
> way. If I use fork="false" then I get a quality error message
> 
> 
> BUILD FAILED
> File...... file:/home/andy/work/myapp/samples/hello/
> Element... ant:java
> Line...... 46
> Column.... 26
> java.lang.NoClassDefFoundError: org/w3c/dom/Node
> Total time: 6 seconds
> Finished at: Tue Jan 20 15:09:57 GMT 2004
> 
> 
> Its failing to find things that *are* in the CLASSPATH 
> provided. I've tried 
> the following
> a). Adding 
> <properties><classloader>root</classloader></properties> to all 
> dependencies
> b). Adding xerces/xmlParserAPIs-2.2.1 to the dependencies 
> (even though it is 
> in the JDK that I'm using).
> 
> I'm using maven-1.0-rc1. None of the above has any positive 
> effect (the second 
> option just moves the error to org/w3c/dom/Document instead of Node). 
> 
> So the question is, how can I get my goal to run, by either
> a). allowing me to use stdin/stdout ?
> b). get Maven to provide a sensible classloading for the 
> ant:java task to use 
> ?
> 
> 
> TIA
> -- 
> Andy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to