Bug 48330 - taskdef task fails to include ant-contrib tasks unless environment classpath set
Summary: taskdef task fails to include ant-contrib tasks unless environment classpath set
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.1
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 10:21 UTC by J.D. Bertron
Modified: 2009-12-02 10:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J.D. Bertron 2009-12-02 10:21:13 UTC
The task: <taskdef resource="net/sf/antcontrib/antlib.xml"/> fails to find the ant-contrib tasks, despite the ant-contrib.jar appearing in both the ant.lib and java.class.path when running ant -diagnostics (below).
However, when setting the environment variable CLASSPATH to equal the value of java.class.path, the taskdef succeeds.
NOTE: The new value reflected by java.class.path is now double the original size and references ant-contrib.jar twice.

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


After exporting CLASSPATH:

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/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:/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
Comment 1 J.D. Bertron 2009-12-02 10:44:07 UTC
On further investigation, only exporting CLASSPATH=/usr/share/ant/lib/ant-contrib.jar was enough to resolve the issue. This still doesn't exclude a possible conflict between libraries but it definitely helps narrow down a test case.