According to the Library Dependencies section of the Installing Ant page of the Ant User Manual, there are two options for providing external library Jar files to Ant: - copying the Jar file to Ant's lib directory - adding the Jar file's pathname to the system CLASSPATH environment variable before running Ant's wrapper script (Apparently, one can also use $HOME/.antrc to set the CLASSPATH environment for the wrapper script.) None of these methods allow the user to define the class paths for external libraries in or via the Ant build file. Given that users can use properties to specify where to find Jar files for libraries used by their applications, and can set property values to select different versions of those libraries, users might also want to use properties to specify the location of libraries needed by optional tasks. Maybe there should be some kind of task that lets the user specify a class path that is used to look for classes needed by optional tasks.
If it's an optional task then, presumably, it's being <taskdef>'d, and <taskdef> does allow for classpath to be specified. Is that not sufficient for your need?
There is also -lib now. Recommend for closing.
*** This bug has been marked as a duplicate of bug 28228 ***