Custom task libraries always need to be explicitly declared in the build
file using <taskdef> (and possibly <typedef> as well). This element takes an
optional <classpath>, and if not specified, uses the CLASSPATH or whatever's
in $ANT_HOME\lib (automaticalled added to CLASSPATH by ant.bat/sh). Simply
specify that nested <classpath> to load the Tomcat Ant library. Ideally,
you'd avoid absolute paths to find that JAR, and possibly either use an env.
var. or a Java/Ant property (set ANT_OPTS=-DCATALINA_HOME=... in your env).
Does that make sense? --DD
-----Original Message-----
From: Erik Price [mailto:eprice@ptc.com]
Sent: Monday, April 07, 2003 11:45 AM
To: Ant Users List
Subject: Ant dependencies
Hi,
I would like to execute ant and give it access to the catalina-ant.jar
library that comes with Tomcat 4.1.x. However, I do not have privileges
to copy this JAR into $ANT_HOME/lib. What is the recommended way to add
this library to Ant's (own) classpath so that I can use tasks from this
JAR? Is there a technique that I can use with ~/.antrc for this?
If possible I'd like to avoid making a duplicate of the JAR as disk
space is a small issue.
Thanks,
Erik
|