Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-2054

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

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4
    • Labels:
      None
    • Environment:
      WinXp
    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Number of attachments :
      3

      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

        Issue Links

          Activity

          Hide
          Brian 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 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.
          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] ------------------------------------------------------------------------
          Hide
          Brian 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 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.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: