ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Lawson" <>
Subject RE: Setting classpath for optional task
Date Fri, 02 Mar 2001 09:45:11 GMT
We used

<path id="project.classpath" >
    <pathelement path="${tomcat_home}/webapps/${project}/WEB-INF/classes" />
    <pathelement location="${ant_home}/lib/ant.jar" />
    <pathelement location="${ant_home}/lib/optional.jar" />
location="${build_dir}/common/servlet2.2/servletapi/lib/servlet.jar" />
    <pathelement location="${build_dir}/common/junit3.2/junit.jar" />
    <pathelement location="${build_dir}/common/HttpUnit/lib/httpunit.jar" />
location="${build_dir}/common/JTidy/jtidy-04aug2000r6/build/Tidy.jar" />
<target name="runtests" depends="init" >
   <junit haltonfailure="off" haltonerror="off" printsummary="on" >
      <classpath refid="project.classpath" />
      <formatter type="plain" />
      <test name="com.blah.blah.AllTests" haltonfailure="off"
haltonerror="off" outfile="alltests" />


-----Original Message-----
From: Nico Seessle []
Sent: 01 March 2001 19:19
Subject: Re: Setting classpath for optional task

----- Original Message -----
From: "William Lee" <>
To: "Ant User" <>
Sent: Thursday, March 01, 2001 6:47 PM
Subject: Setting classpath for optional task

> Is there a way I can set the classpath for the optional tasks WITHIN the
> ant build.xml?  For now, if I want to use a task such as JUnit, I need
> to set the classpath explicitly before I call the ant main class.  Since
> I don't really want to depend on the environment variable CLASSPATH for
> various reasons, I can't really use the "ant" script to invoke the
> build.xml that has a JUunit task.  I ended up writing something similar
> to the "ant" with my custom CLASSPATH.  Is there anyway to get around
> it?

You could try to "redefine" the junit-task using something like

<taskdef name="junit"
    <fileset dir="./lib">
       <include name="junit.jar"/>

Don't know if this works (and if I have made some errors above) - just try


View raw message