ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: ant & junit works on win98, fails on deadrat 6.2
Date Tue, 29 Jan 2002 14:08:28 GMT
On Mon, 28 Jan 2002, Ray Tayek <rtayek@mediaone.net> wrote:

> i cleaned up the script and added junit.jar to the classpath as you
> suggested. i still get a build failed. the same file works on
> windoze (with the actual path changed to "d:/...").

It works on Windows because junit is part of your CLASSPATH there, I'm
100% sure of this.

> "[junit] Could not create task of type: junit Common solutions are
> adding the task to the defaullts.properties and executing
> /bin/bootstrap." before the build failed.

You have exactly two choices to get <junit> to work:

(1) place optional.jar and junit.jar into your CLASSPATH (or
ANT_HOME/lib which means you place add it to your CLASSPATH
implicitly).

or

(2) remove optional.jar from your CLASSPATH or the junit classes from
that jar; remove junit.jar from your CLASSPATH; in each build file
that uses <junit>, add a taskdef before invoking the task that looks
like

<taskdef name="junit" 
         classname="org.apache.tools.ant.taskdefs.junit.JUnitTask">
  <classpath>
    <pathelement location="your location of junit.jar" />
    <pathelement location="your location of optional.jar or the extracted junit classes
of optional.jar" />
  </classpath>
</taskdef>

I'd go for (1) if I were you 8-)

The rule of thumb for all optional tasks that require external
libraries is: if the definition of the task is part of the system
CLASSPATH, all libraries it needs have to be on the system CLASSPATH
as well.

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message