Maven
  1. Maven
  2. MNG-2054

Multiple Inheritence causes plugin executions to run multiple times (Test Case Attached)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4
    • Labels:
      None
    • Environment:
      WinXp

      Description

      See the attached sample. If a plugin execution is set in a parent of a parent, when the child is built from either aggregator, the plugin execution runs multiple times. In my sample, I set the sources to be generated, but when run, see that the sources are generated and installed 2x.

      [INFO] Building jar: E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-tests.jar
      [INFO] [install:install]
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT.jar to f:\mavenRepo\sampl
      e-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT.jar
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-sources.jar to f:\mavenRe
      po\sample-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT-sources.jar
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-sources.jar to f:\mavenRe
      po\sample-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT-sources.jar
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-tests.jar to f:\mavenRepo
      \sample-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT-tests.jar
      [INFO]

      If run directly from the child build, the sources are only built 1x:
      [INFO] [jar:jar]
      [INFO] Building jar: E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT.jar
      [INFO] [source:jar

      {execution: attach-source}

      ]
      [INFO] Building jar: E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-sources.jar
      [INFO] [jar:test-jar

      {execution: default}

      ]
      [INFO] Building jar: E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-tests.jar
      [INFO] [install:install]
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT.jar to f:\mavenRepo\sampl
      e-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT.jar
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-sources.jar to f:\mavenRe
      po\sample-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT-sources.jar
      [INFO] Installing E:\STC\sample\sample-parent2\sample-jar\target\sample-jar-SNAPSHOT-tests.jar to f:\mavenRepo
      \sample-project\sample-jar\SNAPSHOT\sample-jar-SNAPSHOT-tests.jar

      1. sample.zip
        6 kB
        Brian Fox
      2. sample-regression.zip
        19 kB
        Brian Fox
      3. antrun2.tgz
        0.7 kB
        kenneyw

        Issue Links

          Activity

          Brian E. Fox created issue -
          Hide
          Brian E. Fox added a comment -

          Further investigation using help:effective-pom shows that the plugin configuration actually gets included 2x in the pom. Shouldn't executions with the same name be merged with their parent?

          Show
          Brian E. Fox added a comment - Further investigation using help:effective-pom shows that the plugin configuration actually gets included 2x in the pom. Shouldn't executions with the same name be merged with their parent?
          Carlos Sanchez made changes -
          Field Original Value New Value
          Fix Version/s 2.0.3 [ 12107 ]
          Priority Major [ 3 ] Critical [ 2 ]
          Carlos Sanchez made changes -
          Link This issue is related to MNG-1701 [ MNG-1701 ]
          John Casey made changes -
          Fix Version/s 2.0.4 [ 12294 ]
          Fix Version/s 2.0.3 [ 12107 ]
          Hide
          Brian E. Fox added a comment -

          I verified in my sample and in my real project that this appears to be fixed in 2.0.3. The fixed version should be updated so that the JIRA report reflects the correct information. I'd like to see this get created as an integration test to prevent future regresion, but I'm not 100% sure how to test for this condition.

          Show
          Brian E. Fox added a comment - I verified in my sample and in my real project that this appears to be fixed in 2.0.3. The fixed version should be updated so that the JIRA report reflects the correct information. I'd like to see this get created as an integration test to prevent future regresion, but I'm not 100% sure how to test for this condition.
          Hide
          John Casey added a comment -

          confirmed fixed by Brian Fox, I just added a variant of sample.zip as it0096.

          Show
          John Casey added a comment - confirmed fixed by Brian Fox, I just added a variant of sample.zip as it0096.
          John Casey made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          John Casey made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          John Casey made changes -
          Fix Version/s 2.0.4 [ 12294 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Assignee John Casey [ jdcasey ]
          Fix Version/s 2.0.3 [ 12107 ]
          Hide
          Brian E. Fox added a comment -

          There was some regression on this issue between the RC and the final version. In 2.0.2, the sample ran the sources jar 3 times. In 2.0.3 RC, it ran only once (correct). In 2.0.3 final it now runs 2 times:

          [INFO] Installing E:\svn\dsms-2.1\legacy\hl7\target\hl7-2.1.0.7-SNAPSHOT.jar to
          e:\stc\mavenRepo\com\stchome\products\dsms\legacy\hl7\2.1.0.7-SNAPSHOT\hl7-2.1.0
          .7-SNAPSHOT.jar
          [INFO] Installing E:\svn\dsms-2.1\legacy\hl7\target\hl7-2.1.0.7-SNAPSHOT-sources
          .jar to e:\stc\mavenRepo\com\stchome\products\dsms\legacy\hl7\2.1.0.7-SNAPSHOT\h
          l7-2.1.0.7-SNAPSHOT-sources.jar
          [INFO] Installing E:\svn\dsms-2.1\legacy\hl7\target\hl7-2.1.0.7-SNAPSHOT-sources
          .jar to e:\stc\mavenRepo\com\stchome\products\dsms\legacy\hl7\2.1.0.7-SNAPSHOT\h
          l7-2.1.0.7-SNAPSHOT-sources.jar

          Show
          Brian E. Fox added a comment - There was some regression on this issue between the RC and the final version. In 2.0.2, the sample ran the sources jar 3 times. In 2.0.3 RC, it ran only once (correct). In 2.0.3 final it now runs 2 times: [INFO] Installing E:\svn\dsms-2.1\legacy\hl7\target\hl7-2.1.0.7-SNAPSHOT.jar to e:\stc\mavenRepo\com\stchome\products\dsms\legacy\hl7\2.1.0.7-SNAPSHOT\hl7-2.1.0 .7-SNAPSHOT.jar [INFO] Installing E:\svn\dsms-2.1\legacy\hl7\target\hl7-2.1.0.7-SNAPSHOT-sources .jar to e:\stc\mavenRepo\com\stchome\products\dsms\legacy\hl7\2.1.0.7-SNAPSHOT\h l7-2.1.0.7-SNAPSHOT-sources.jar [INFO] Installing E:\svn\dsms-2.1\legacy\hl7\target\hl7-2.1.0.7-SNAPSHOT-sources .jar to e:\stc\mavenRepo\com\stchome\products\dsms\legacy\hl7\2.1.0.7-SNAPSHOT\h l7-2.1.0.7-SNAPSHOT-sources.jar
          Brian Fox made changes -
          Status Closed [ 6 ] Reopened [ 4 ]
          Resolution Fixed [ 1 ]
          Hide
          John Casey added a comment -

          Brian,

          Can you tell me what the key difference is between your project above (dsms-2.1, looks like?) and it0096, which is based on the sample.zip?

          I just re-downloaded sample.zip, and it works fine on this side (running with a copy of mvn I downloaded this morning).

          Show
          John Casey added a comment - Brian, Can you tell me what the key difference is between your project above (dsms-2.1, looks like?) and it0096, which is based on the sample.zip? I just re-downloaded sample.zip, and it works fine on this side (running with a copy of mvn I downloaded this morning).
          Hide
          Brett Porter added a comment -

          Brian, also please detail exactly which RC you are using (time/date). I don't believe anything was changed between the last one and the release.

          Show
          Brett Porter added a comment - Brian, also please detail exactly which RC you are using (time/date). I don't believe anything was changed between the last one and the release.
          Hide
          Brian E. Fox added a comment -

          I was running with 2.0.3-SNAPSHOT that was built on March 2nd. I believe this was one of the earlier RCs.

          I also noticed that the sample seems to work even though it was based on my original project, which doesn't work. I'll go back and see if I can figure out the difference.

          Show
          Brian E. Fox added a comment - I was running with 2.0.3-SNAPSHOT that was built on March 2nd. I believe this was one of the earlier RCs. I also noticed that the sample seems to work even though it was based on my original project, which doesn't work. I'll go back and see if I can figure out the difference.
          Hide
          Brian E. Fox added a comment -

          Apparently the only difference is the number of levels between the plugin definition to the child. This updated sample now produces 3 or more executions of the sources jar

          The only difference between this version and the previous sample is an additional inheritence level.

          Show
          Brian E. Fox added a comment - Apparently the only difference is the number of levels between the plugin definition to the child. This updated sample now produces 3 or more executions of the sources jar The only difference between this version and the previous sample is an additional inheritence level.
          Brian Fox made changes -
          Attachment sample-regression.zip [ 19847 ]
          Brett Porter made changes -
          Fix Version/s 2.0.3 [ 12107 ]
          Fix Version/s 2.0.4 [ 12527 ]
          Brett Porter made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Assignee John Casey [ jdcasey ] Brett Porter [ brettporter ]
          Hide
          Kenney Westerhof added a comment -

          This test shows multiple calls of the same goals. Try 'mvn clean', 'mvn generate-sources', 'mvn package'.
          It contains a parent and a child pom, and when run from the parent pom there are multiple executions of the same
          goals:

          $ mvn -version
          Maven version: 2.0.4-SNAPSHOT

          (http://maven.zones.apache.org/~maven/builds/branches/maven-2.0.x/m2-20060330.155710.tar.gz)

          $ mvn clean

          [INFO] Scanning for projects...
          [INFO] Reactor build order:
          [INFO] parent
          [INFO] child
          [INFO] ----------------------------------------------------------------------------
          [INFO] Building parent
          [INFO] task-segment: [clean]
          [INFO] ----------------------------------------------------------------------------
          [INFO] [clean:clean]
          [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/target
          [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/target/classes
          [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/target/test-classes
          [INFO] [antrun:run

          {execution: test2}

          ]
          [INFO] Executing tasks
          [echo] test2
          [INFO] Executed tasks
          [INFO] ----------------------------------------------------------------------------
          [INFO] Building child
          [INFO] task-segment: [clean]
          [INFO] ----------------------------------------------------------------------------
          [INFO] [clean:clean]
          [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/child/target
          [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/child/target/classes
          [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/child/target/test-classes
          [INFO] [antrun:run

          {execution: test2}

          ]
          [INFO] Executing tasks
          [echo] test2
          [INFO] Executed tasks
          [INFO] [antrun:run

          {execution: childTest2}

          ]
          [INFO] Executing tasks
          [echo] childTest2
          [INFO] Executed tasks
          [INFO] [antrun:run

          {execution: test2}

          ]
          [INFO] Executing tasks
          [echo] test2
          [INFO] Executed tasks
          [INFO] [antrun:run

          {execution: childTest2}

          ]
          [INFO] Executing tasks
          [echo] childTest2
          [INFO] Executed tasks
          [INFO]
          [INFO]
          [INFO] ------------------------------------------------------------------------
          [INFO] Reactor Summary:
          [INFO] ------------------------------------------------------------------------
          [INFO] parent ................................................ SUCCESS [1.022s]
          [INFO] child ................................................. SUCCESS [0.069s]
          [INFO] ------------------------------------------------------------------------
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESSFUL
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 1 second
          [INFO] Finished at: Fri Mar 31 14:18:10 CEST 2006
          [INFO] Final Memory: 2M/6M
          [INFO] ------------------------------------------------------------------------

          Show
          Kenney Westerhof added a comment - This test shows multiple calls of the same goals. Try 'mvn clean', 'mvn generate-sources', 'mvn package'. It contains a parent and a child pom, and when run from the parent pom there are multiple executions of the same goals: $ mvn -version Maven version: 2.0.4-SNAPSHOT ( http://maven.zones.apache.org/~maven/builds/branches/maven-2.0.x/m2-20060330.155710.tar.gz ) $ mvn clean [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] parent [INFO] child [INFO] ---------------------------------------------------------------------------- [INFO] Building parent [INFO] task-segment: [clean] [INFO] ---------------------------------------------------------------------------- [INFO] [clean:clean] [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/target [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/target/classes [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/target/test-classes [INFO] [antrun:run {execution: test2} ] [INFO] Executing tasks [echo] test2 [INFO] Executed tasks [INFO] ---------------------------------------------------------------------------- [INFO] Building child [INFO] task-segment: [clean] [INFO] ---------------------------------------------------------------------------- [INFO] [clean:clean] [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/child/target [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/child/target/classes [INFO] Deleting directory /vol/home/forge/work/sandbox/m2test/antrun2/child/target/test-classes [INFO] [antrun:run {execution: test2} ] [INFO] Executing tasks [echo] test2 [INFO] Executed tasks [INFO] [antrun:run {execution: childTest2} ] [INFO] Executing tasks [echo] childTest2 [INFO] Executed tasks [INFO] [antrun:run {execution: test2} ] [INFO] Executing tasks [echo] test2 [INFO] Executed tasks [INFO] [antrun:run {execution: childTest2} ] [INFO] Executing tasks [echo] childTest2 [INFO] Executed tasks [INFO] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] parent ................................................ SUCCESS [1.022s] [INFO] child ................................................. SUCCESS [0.069s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO] Finished at: Fri Mar 31 14:18:10 CEST 2006 [INFO] Final Memory: 2M/6M [INFO] ------------------------------------------------------------------------
          kenneyw made changes -
          Attachment antrun2.tgz [ 19894 ]
          Hide
          Brian E. Fox added a comment -

          This does seem some how related, but it's not quite the same. The original problem I saw was just the executions defined in the parent got executed a bunch of times. In your case, some of the child executions are rerun too.

          Show
          Brian E. Fox added a comment - This does seem some how related, but it's not quite the same. The original problem I saw was just the executions defined in the parent got executed a bunch of times. In your case, some of the child executions are rerun too.
          Hide
          Brett Porter added a comment -

          Kenney, please file a new bug.

          Show
          Brett Porter added a comment - Kenney, please file a new bug.
          Hide
          Stephen Duncan Jr added a comment -

          I've filed http://jira.codehaus.org/browse/MNG-2221 which I think is the same as Kenney's.

          Show
          Stephen Duncan Jr added a comment - I've filed http://jira.codehaus.org/browse/MNG-2221 which I think is the same as Kenney's.
          Brian Fox made changes -
          Link This issue is related to MNG-2221 [ MNG-2221 ]
          Carlos Sanchez made changes -
          Link This issue is related to MNG-2237 [ MNG-2237 ]
          David Bernard made changes -
          Link This issue is related to MNG-4879 [ MNG-4879 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Mark Thomas made changes -
          Workflow jira [ 12712733 ] Default workflow, editable Closed status [ 12752590 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Workflow jira [ 12952696 ] Default workflow, editable Closed status [ 12990041 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          16d 3h 31m 1 John Casey 24/Feb/06 17:40
          Closed Closed Reopened Reopened
          32d 44m 2 Brian Fox 28/Mar/06 19:24
          Reopened Reopened Closed Closed
          1d 13h 32m 2 Brett Porter 30/Mar/06 08:57

            People

            • Assignee:
              Brett Porter
              Reporter:
              Brian E. Fox
            • Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development