Ant: exclude the jar from the class path. I want him to act as if this does not exist

This is my first ant project, and I just can't get around it. I want to effectively remove the jar and then return it after running unit tests. I think this can be modeled using the exclude command. I also think this should be done under the <classpath> . Am I right in my thoughts? I also want this jar to still exist, I just want my assembly to ignore it when I launch this specific target. I tried this:

 <junit fork="no" showoutput="false" printsummary="yes" haltonfailure="false"> <classpath> <fileset dir="${lib.dir}"> <exclude name="**/*xmlparserv2.jar" /> </fileset> </classpath> </junit> 

But to no avail. Can someone point me in the right direction?

+4
source share
2 answers

I ended up moving the can during my tests. First, I delete it and save the link in the root path of my class. Then, at the end, I just copy it: for example.

 <delete file="lib/xmlparserv2.jar"/> <!--run lots of tests--> <copy todir="lib" file="xmlparserv2.jar"/> 
+2
source

To exclude matches for the whole name, try:

 <exclude name="**/*xmlparserv2.jar" /> 
+2
source

All Articles