commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject Re: [math] junit and ant build
Date Sat, 14 Jun 2003 02:16:02 GMT
Mark R. Diggory wrote:
> I've always been using Eclipse/Ant to build the project. In which case 
> JUnit is already present on the classpath for Ant (Either that or adding 
> it was just so damn simple I forgot I did it). I was just testing Ant 
> outside of Eclipse from the command line and I noticed that it fails 
> because junit isn't installed in the same directory as ant-optional.jar. 
> This is something I can easily fix by placing a junit.jar in the 
> ANT_HOME/lib directory, but....
> This seems wierd that it is always the case that the ant build won't 
> work the first time through. The maven generated build downloads that 
> junit jar, but because the way Maven generates the build.xml, it doesn't 
> generate a new classpath and use a taskdef to define the junit task with 
> the new classpath info to effectively run the junit task. It seems 
> logical that if JUnits going to be automatically download as a 
> dependency, the Ant script should be setup properly to use it. I though 
> to myself, maybe it was shortsighted of Maven to not do this in the 
> generated build.xml.
> Should we expect anyone who wants to build the project to properly setup 
> JUnit in Ant before hand? Or should we try to find a way to get the 
> "downloaded" junit into the classpath for the junit task? We have to be 
> carefull here because we're using  Maven to generate the build.xml, this 
> limits me from just going in and directly changing it because it'll just 
> get overwritten later when the build.xml is updated by maven.

I would not recommend hacking the maven-generated build.xml. I have run 
into this same problem before with other scripts that use the optional 
Junit tasks (e.g. struts build.xml).  You need to copy junit.jar to 
ANT_HOME/lib and get this defined in the classpath.  When I run ant from 
the command line, I always wrap it in a script that explicitly sets the 
classpath (and the JDK).  The that I used with the original 
(pre-maven-generated build.xml) still works for me.  I don't think that 
it is unreasonable to expect users who run ant from the command line to 
set the classpath and get junit.jar into ANT_HOME/lib.  A note somewhere 
indicating the second requirement would be a good idea.


> -Mark
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message