ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Lee <>
Subject Can't find <junit> in optional.jar?
Date Wed, 31 Jan 2001 19:52:11 GMT
I am having problem with the latest Ant (checked out from cvs as of
1/31) when using the <junit> task.  First off, if I use the default
"ant" script to execute a build file that uses <junit>, it would
complain that the task is not found and ask me to put the optional.jar
in the Ant's lib dir.  I do have the optional jar in the directory

I also tried to define the junit task manually using taskdef (note that
the junit.jar is in the ../lib directory relative to where the build.xml

  <path id="classpath">
    <fileset dir="lib">
      <include name="**/*.jar"/>
    <fileset dir="../../../../lib">
      <include name="**/*.jar"/>
    <fileset dir="../lib">
      <include name="**/*.jar"/>
    <pathelement path="${java.class.path}"/>

  <taskdef name="junit"
    <classpath refid="classpath"/>

  <target name="test">
  <junit printsummary="yes" haltonfailure="yes">
    <classpath refid="classpath"/>
    <formatter type="plain" />
    <batchtest fork="yes" todir="${reports.tests}">
      <fileset dir="${build.dest}">
        <include name="**/test/*Test*.java" />
        <exclude name="**/" />

I got the error reporting that the junit/framework/TestListener class is
not found.  Is there anything wrong with the build file?


View raw message