First off run:
maven -X test
Then look at the "[javac] [DEBUG] fileset:" entry for test:compile. Mine looks like this:
[javac] [DEBUG] fileset: Setup scanner in dir G:\test\maven-test-plugin-sourceModifications\src\test with patternSet{ includes: [org/apache/commons/logging/*.java, org/apache/commons/logging/impl/LogFactoryImpl.java, org/apache/commons/logging/impl/WeakHashtable.java, org/apache/commons/logging/impl/SimpleLog.java, org/apache/commons/logging/impl/NoOpLog.java, org/apache/commons/logging/impl/Jdk14Logger.java, test/org/apache/commons/logging/SimpleLogTestCase.java] excludes: [test/org/apache/commons/logging/servlet/*TestCase.java, **/package.html] }
Now go to the pom and remove the comments as specified in there. Run it again:
maven -X clean test
This time the build fails. Look at the fileset again. Mine looks like this:
[javac] [DEBUG] fileset: Setup scanner in dir G:\test\maven-test-plugin-sourceModifications\src\test with patternSet{ includes: [] excludes: [**/package.html] }
Now that is the default values. What has happend here is that the section that was un-commented from the pom will cause the property called "classPresent" to be set during java:compile. That property can not be unset using ant. Because the java-plugin and test-plugin uses the same property-name, it is highjacked and test:compile will fail because of it.
I fiddled around in the test-plugin and managed to solve this problem. Will attach patch shortly.