Cannot build the test jar unless JUnit is present

  • Share
  • Share

Applies to:
Ant 1.7.0

Description:
Ant 1.7.0 doesn’t build from sources without JUnit

Cause:
When building Ant 1.7.0 from the source release without junit.jar the build fails with the message “We cannot build the test jar unless JUnit is present”.
With Ant 1.7.0 ant-testutil.jar is added as part of the distribution and this causes a hard dependency on JUnit – at least in version 1.7.0.

JAVA-Tools , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

  1. admin
    March 20th, 2009 at 10:28 | #1

    There are two workarounds:
    1. Add junit.jar to your CLASSPATH when building Ant.
    2. Change Ant’s buildfile and remove test-jar from the depends list of the dist-lite target.

  1. No trackbacks yet.