ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Skip Hovsmith" <>
Subject Lesson learned in building optional.jar
Date Tue, 06 Mar 2001 19:16:18 GMT
Just thought I'd pass on a lesson learned in building optional.jar.

I wrap most java apps with a script which sets the appropriate classpath. My
default classpath is empty.

With ant 1.3, I built the source using 'ant install'. The ant script
included the jars it needed, but couldn't include the optional dependencies
such as junit.jar. The build install ran and completed successfully.

Next I fire up ant with a known build.xml file which dutifully sets
junit.jar when running the junit task. The junit task fails saying it can't
find the test runner. When I look for the test runner in optional.jar, it's
not there! After wondering (perhaps a mild understatement) how the ant
developers could leave the junit tasks out of optional.jar, I finally catch
on that the classes weren't added to the optional.jar because I didn't have
junit.jar on my classpath for the original build install. Obvious now, but
it sure tripped me up for a while...

The original build install probably output that it failed to build some of
the junit related classes, but I just saw the build completed okay message
at the end and mindlessly moved on.

So, if your optional.jar is missing some tasks, make sure you've added all
the optional dependency jars to your classpath before building ant or just
grab the optional.jar off the ant distribution.

Regards, Skip Hovsmith

View raw message