ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Mailhot <>
Subject RE: optional task jars
Date Tue, 20 Jul 2004 19:36:34 GMT
On mar, 2004-07-20 at 13:54 -0500, Dominique Devienne wrote:
> > From: []
> > 
> > In my installation of ant I am not allowed to put any of the jars required
> > for the optional tasks in the ant lib directory.  They have to go in
> > another directory.  What is the best way to get those jar files on to the
> > class path.  For custom tasks like ant-contrib I use the classpath
> > reference to the taksdef or the typedef.  I need to use sshexec and scp is
> > there  any way to get a classpath reference to the appropriate jar file to
> > use sshexec and scp?
> The easiest way is to have a wrapper script (our are build.bat/.sh) around
> Ant that does project specific things, and call ant with the -lib switch to
> automatically add all the JARs in the directory following the -lib to Ant's
> classpath.

One of the patches we apply at jpackage consists of defining an env var
that is added to the ant classpath (and can be defined in the ~/.antrc
for example).

The default ant/lib is almost empty and we discourage its use - if the
user does not define the classpath variable a default system-wide value
is used instead.

The reason we do it this way is any user can tweak the classpath his ant
will use instance, jars are not mindlessly duplicated all over the place
in private lib dirs, and jar ordering is defined (this last being more a
positive side-effect than a design target, relying on jar ordering is
dangerous practise but sometime people need it).

I must admit I toyed a moment with a ~/.ant/lib but (apart from being a
bit more difficult to implement) it seemed very awkward to use.

I don't know if it's ever been merged upstream - probably not, since we
do not use a traditional classpath format, but our own simplified
notation that is fed to a routine that searches actual jar location on
the system to assemble a classic classpath.


Nicolas Mailhot

View raw message