Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 48258

Summary: ant 1.6.1 ignores jars in ~/.ant/lib directory
Product: Gentoo Linux Reporter: Haroon Rafique <corporate_gadfly>
Component: [OLD] DevelopmentAssignee: Java team <java>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
URL: http://ant.apache.org/manual/running.html#libs
Whiteboard:
Package list:
Runtime testing required: ---

Description Haroon Rafique 2004-04-18 12:49:41 UTC
According to http://ant.apache.org/manual/running.html#libs, starting from version 1.6, ant is able to add jars from user specific directory, ${user.home}/.ant/lib. I noticed that ant was ignoring that directory all together. I'm not an ant expert but looking at the vanilla ant script found in dist/bin/ant, I can see that they use the org.apache.tools.ant.launch.Launcher as the class to use. However, the gentoo /usr/bin/ant uses org.apache.tools.ant.Main as the class to use. Looking at the ant sources, I think ./src/main/org/apache/tools/ant/launch/Launcher.java is the only place where ant scans the ${user.home}/.ant/lib directory.

The obvious fix to try was to replace org.apache.tools.ant.Main with org.apache.tools.ant.launch.Launcher in /usr/bin/ant. I tried that with mixed results. To tell you the whole story I have a clover.jar file in ${user.home}/.ant/lib. Before making the Main to Launcher switch I wasn't even getting the clover <taskdefs> to show up (since the clover.jar never made it into the classpath). After making the switch from Main to Launcher, I could get the task to be recognized but got errors duing javac compilation:

Compiler Adapter 'org.apache.tools.ant.taskdefs.CloverCompilerAdapter' can't be found.

In any case, I have a pretty good idea that the gentoo ant script is broken, since I can use the vanilla ant script without any problems (its able to see the jars in ${user.home}/.ant/lib). Here's what I do to use the vanilla ant:

export ANT_HOME=/home/haroon/src/build/apache-ant-1.6.1/dist

and then execute ant as:

/home/haroon/src/build/apache-ant-1.6.1/dist/bin/ant

I can provide more details upon request.

Versions: 
dev-java/java-config-1.2.6
dev-java/sun-jdk-1.4.2.04-r1
dev-java/ant-1.6.1

Portage 2.0.50-r6 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.4.24-ck1)
=================================================================
System uname: 2.4.24-ck1 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz
Gentoo Base System version 1.4.8
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2)
(default port 3632) [enabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -s -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -ffast-math"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /etc/tomcat /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.1/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -s -fomit-frame-pointer
-fforce-addr -falign-functions=4 -fprefetch-loop-arrays -ffast-math"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox userpriv usersandbox"
GENTOO_MIRRORS="http://mirrors.tds.net/gentoo ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://csociety-ftp.ecn.purdue.edu/pub/gentoo/ http://csociety-ftp.ecn.purdue.edu/pub/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo"
MAKEOPTS="-j11"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage.local"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm arts avi berkdb bonobo cdr crypt cups encode
esd foomaticdb gdbm gif gpm gtk gtk2 gtkhtml guile imlib java jikes jpeg
junit ldap libg++ libwww mad mbox mikmod motif mozilla mpeg mysql ncurses
nls offensive oggvorbis opengl oss pam pdflib perl png postgres python qt
quicktime readline sdl slang spell ssl svga tcltk tcpd tetex tiff truetype
x86 xinerama xml2 xmms xv zlib"
Comment 1 Haroon Rafique 2004-04-18 12:53:19 UTC

*** This bug has been marked as a duplicate of 48259 ***