#237 taskdef fails to include ant-contrib unless classpath env is

open
nobody
None
5
2009-12-02
2009-12-02
Anonymous
No

According to installation instructions, the ant-contrib.jar should be in the Ant lib path or Java class path.
However, using Ant 1.7.1 and ant-contrib-1.0-0.6b2, the taskdef fails to find the definitions:
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.

yet the ant -diagnostics reports the file in both the ant lib path and the java class path:

$ ant -diagnostics | grep contrib
ant-contrib.jar (196528 bytes)
java.class.path : /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/bsf.jar:/usr/share/java/ant/ant-apache-bsf.jar:/usr/share/java/log4j.jar:/usr/share/java/ant/ant-apache-log4j.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/jakarta-commons-net.jar:/usr/share/java/ant/ant-commons-net.jar:/usr/share/java/javamail.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/share/java/xalan-j2-serializer.jar:/usr/java/jdk1.5.0_16//lib/tools.jar:/usr/share/ant/lib/ant-apache-bsf.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-jakarta-bcel.jar:/usr/share/ant/lib/ant-contrib.jar:/usr/share/ant/lib/ant-apache-oro-1.7.1.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-commons-net-1.7.1.jar:/usr/share/ant/lib/ant-nodeps-1.7.1.jar:/usr/share/ant/lib/ant-antlr-1.7.1.jar:/usr/share/ant/lib/ant-jakarta-regexp.jar:/usr/share/ant/lib/ant-apache-bsf-1.7.1.jar:/usr/share/ant/lib/ant-apache-log4j.jar:/usr/share/ant/lib/ant-jsch-1.7.1.jar:/usr/share/ant/lib/ant-apache-resolver.jar:/usr/share/ant/lib/ant-apache-regexp-1.7.1.jar:/usr/share/ant/lib/ant-swing-1.7.1.jar:/usr/share/ant/lib/ant-commons-logging.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-jdepend-1.7.1.jar:/usr/share/ant/lib/ant-commons-net.jar:/usr/share/ant/lib/ant-apache-bcel.jar:/usr/share/ant/lib/ant-apache-resolver-1.7.1.jar:/usr/share/ant/lib/ant-jakarta-oro.jar:/usr/share/ant/lib/ant-apache-oro.jar:/usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-javamail-1.7.1.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-jakarta-log4j.jar:/usr/share/ant/lib/ant-apache-bcel-1.7.1.jar:/usr/share/ant/lib/ant-junit-1.7.1.jar:/usr/share/ant/lib/ant-apache-regexp.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-trax.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-commons-logging-1.7.1.jar:/usr/share/ant/lib/ant-trax-1.7.1.jar:/usr/share/ant/lib/ant-apache-log4j-1.7.1.jar:/usr/share/ant/lib/GenJar.jar

However, once the value of java.class.path is exported to the environment CLASSPATH variable, the task succeeds.

The new diagnostics class path is twice as long and the ant-contrib.jar appears twice in the value.

Could this possibly be a conflict between libraries on the path ?

Discussion