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
BEGIN:VCARD
VERSION:2.1
N:Hovsmith;Skip
FN:Skip Hovsmith
ORG:Maple Rise
TEL;WORK;VOICE:+1 (650) 851-1612
TEL;WORK;FAX:+1 (650) 851-1612
ADR;WORK:;;755 Patrol Road;Woodside;CA;94062-4224;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:755 Patrol Road=0D=0AWoodside, CA 94062-4224=0D=0AUnited States of America
ADR;HOME:;;;;;;United States of America
LABEL;HOME:United States of America
URL:http://www.maplerise.com
BDAY:19590128
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20000831T220809Z
END:VCARD

Reply via email to