https://issues.apache.org/bugzilla/show_bug.cgi?id=44849
Summary: ant does not load libraries from ~/.ant/lib when ant.jar
is on the classpath
Product: Ant
Version: 1.7.0
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
I've been investigating a problem with loading 3rd-party tasks like ivy,
obfuscate, and jalopy from the ~/.ant/lib directory on a Fedora Core 6 system
with the vendor-provided ant-1.6.5 package. When I upgraded to ant-1.7.0 from
FC8 it had the same problem, but the problem does not exist with ant-1.6.2 from
FC4. When I build and install ant-1.7.0 in my home directory, it will work
only if the vendor ant package is not installed or I run ant with the
--noconfig option.
After trying to start the launcher directly with various configurations, I
discovered that while the following command works:
java -classpath /home/tbeattie/src/ant-1.7.0/lib/ant-launcher.jar
-Dant.home=/home/tbeattie/src/ant-1.7.0
-Dant.library.dir=/home/tbeattie/src/ant-1.7.0/lib
org.apache.tools.ant.launch.Launcher -cp ''
this command fails:
java -classpath
/home/tbeattie/src/ant-1.7.0/lib/ant-launcher.jar:/home/tbeattie/src/ant-1.7.0/lib/ant.jar
-Dant.home=/home/tbeattie/src/ant-1.7.0
-Dant.library.dir=/home/tbeattie/src/ant-1.7.0/lib
org.apache.tools.ant.launch.Launcher -cp ''
The only difference is adding ant.jar to the -classpath (and this is the
locally installed ant.jar, not the vendor ant.jar). The error is:
----------------------------------------------
Buildfile: build.xml
resolve:
BUILD FAILED
/home/tbeattie/src/apache-ivy-2.0.0-beta2/src/example/hello-ivy/build.xml:38:
Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/home/tbeattie/src/ant-1.7.0/lib
-/home/tbeattie/.ant/lib
-a directory added on the command line with the -lib argument
Total time: 0 seconds
==============================================
Note that the system-wide ant configuration file /etc/ant.conf installed by
Fedora sets rpm_mode=true by default, which causes the ant startup script to
set LOCALCLASSPATH to include ant.jar. Since build-classpath only searches
system java directories, I don't think it's possible to test a local install of
the ant startup script with "rpm_mode=true" (it can't find ant-launcher). You
can only test with a system install.
The converse cannot be directly tested on a vendor ant install because it
cannot find org.apache.tools.ant.Main if ant.jar is not on the classpath.
I believe this is the same bug that was reported in 35060. I am not certain
whether it is related to bug 41587.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.