Hi, I'm currently looking into Bug 14971. This bug points out an inconsistency in <junit> that has been there for ages and I'm a bit unsure on how to fix it.
<junit fork="true" includeantruntime="yes"> will run the forked tests with a classpath containing ant.jar, optional.jar and junit.jar, nothing else. <junit fork="true" includeantruntime="no"> will run the forked tests with whatever is in the CLASSPATH env variable as it doesn't pass an explicit -classpath argument at all. If the <junit> task has a nested <classpath>, things are different, your CLASSPATH will never be used as there will always be a -classpath argument. I'm not sure, how this should be resolved. Even if we add a new attribute, I don't see a default setting that would preserve the old behavior. Well, maybe I do. Something like addsystemclasspath with a default of false that would query the native environment for CLASSPATH. Maybe we don't have a bug at all and we can say that you get exactly the classpath you are asking for? This doesn't hold as you don't get an empty CLASSPATH when you specify nothing. Ideas? Stefan