cwd != null && cwd.trim().length() > 0 ? cwd :
ProjectUtils.getPath(project)));
junit.setHaltonerror(halt);
junit.setHaltonfailure(halt);
junit.createClasspath().append(classpath);
// we need to add ant.jar to the classpath for the ant test runner to work,
// but then JUnitTask will complain about multiple ant jars, so prevent
// that.
Field forkedPathChecked =