Issue Details (XML | Word | Printable)

Key: MPTEST-68
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Lukas Theussl
Reporter: Dennis Lundberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Test Plugin

SourceModifications sometimes does not work for test classes

Created: 24/Jul/06 05:27 PM   Updated: 24/Jul/06 07:01 PM
Component/s: None
Affects Version/s: 1.6.2
Fix Version/s: 1.8.1

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive maven-test-plugin-sourceModifications.zip (34 kB)
2. Text File MPTEST-68.patch (0.7 kB)

Environment: Win XP, Maven 1.0.2

Testcase included: yes


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dennis Lundberg added a comment - 24/Jul/06 05:44 PM
By using another name for the property than maven-java-plugin does, the effects of this issue is minimized.

Dennis Lundberg added a comment - 24/Jul/06 05:45 PM
Oh, I forgot: the patch is against SVN head.

Lukas Theussl added a comment - 24/Jul/06 06:48 PM
Patch applied. Thanks!

Lukas Theussl added a comment - 24/Jul/06 07:01 PM
Wait a minute... why am I doing that? You are a maven committer!