Maven 1.x Test Plugin
  1. Maven 1.x Test Plugin
  2. MPTEST-68

SourceModifications sometimes does not work for test classes

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.8.1
    • Labels:
      None
    • Environment:
      Win XP, Maven 1.0.2
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      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.

        Activity

        Hide
        Dennis Lundberg added a comment -

        By using another name for the property than maven-java-plugin does, the effects of this issue is minimized.

        Show
        Dennis Lundberg added a comment - By using another name for the property than maven-java-plugin does, the effects of this issue is minimized.
        Hide
        Dennis Lundberg added a comment -

        Oh, I forgot: the patch is against SVN head.

        Show
        Dennis Lundberg added a comment - Oh, I forgot: the patch is against SVN head.
        Hide
        Lukas Theussl added a comment -

        Patch applied. Thanks!

        Show
        Lukas Theussl added a comment - Patch applied. Thanks!
        Hide
        Lukas Theussl added a comment -

        Wait a minute... why am I doing that? You are a maven committer!

        Show
        Lukas Theussl added a comment - Wait a minute... why am I doing that? You are a maven committer!

          People

          • Assignee:
            Lukas Theussl
            Reporter:
            Dennis Lundberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: