Bug 7081 - junit class loading problems
Summary: junit class loading problems
Status: RESOLVED DUPLICATE of bug 38799
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.4.1
Hardware: Other All
: P3 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2002-03-13 11:27 UTC by wookie
Modified: 2008-02-22 12:18 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description wookie 2002-03-13 11:27:36 UTC
error with following target

<target name="test" depends="build,properties">
    <junit printsummary="yes" haltonerror="yes" haltonfailure="yes">
      <formatter type="brief"/>
        <pathelement location="${classes.dir}"/>
        <pathelement location="${base.dir}\properties"/> 
        <pathelement location="${unity.jar}"/>
        <fileset dir="${lib.dir}">
          <include name="**/*.jar"/>
      <test name="test.AllTests"/>


where lib.jar contains both mytask.jar and junit.jar

The ant junit task does not utilise the settings of the classpath correctly.
It seems to expect the junit jar to be made available prior to the classpath
statement telling it where to locate the jar and thus fails.

Its clearly visible in the ant code.

I have had to deploy junit.jar into the ant lib folder which is not good.

Also an additional task I have written needs to be deployed into the 
lib folder before it will pick it up, is there any way around this.
Comment 1 Stefan Bodewig 2002-03-13 12:10:44 UTC
The alternative is to remove optional.jar from ANT_HOME/lib and put it into
a classpath that contains junit.jar as well inside a taskdef to redeclare

*** This bug has been marked as a duplicate of 6606 ***
Comment 2 Jesse Glick 2006-02-27 20:43:27 UTC
More precise duplicate.
Comment 3 Jesse Glick 2006-02-27 20:43:44 UTC

*** This bug has been marked as a duplicate of 38799 ***