At my work we use AspectJ in some of our Java projects. To get this to work with ant builds we have been placing aspectjtools.jar within ant/lib/.
I am now working on a particular Java project and need to use a newer version of aspectJ. I don't want to have to get everyone who uses the project to update their local copy of aspectjtools.jar. Instead, I tried adding the newer aspectjtools.jar to the lib directory of the project and adding the following line to build.xml.
<taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"
classpath="./lib/aspectjtools.jar" />
However, this doesn't work as I hoped as the ANT classloader loads jars from ant/lib/ in preference to the jar I specify in the taskdef classpath.
Is there any way to force ant to pick the jar checked into my project instead?
The ultimate answer to my question is no. The is currently no way for ANT to use a task jar from a project in preference to a task jar in the ANT lib directory.