Maven
  1. Maven
  2. MNG-2221

Multiple Executions of Plugin at Difference Inhertiance levels causes plugin executions to run multiple times

    Details

    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      Can occur in a variety of ways, but the attached test case shows a parent pom defining an antrun-execution, and then a child specifying another execution with a different id. Both executions run twice when running from the child.

      I believe this is the same as Kenney Westerhof's comment: http://jira.codehaus.org/browse/MNG-2054#action_62477

        Issue Links

          Activity

          Hide
          Stephen Duncan Jr added a comment -

          More details on how to run the test.

          cd repeat-parent-test
          mvn install
          cd ../repeat-child-test
          mvn package

          You will see 2 executions of each antrun.

          Show
          Stephen Duncan Jr added a comment - More details on how to run the test. cd repeat-parent-test mvn install cd ../repeat-child-test mvn package You will see 2 executions of each antrun.
          Hide
          brianfox brianfox added a comment -

          Interesting because this is exactly what I was seeing pre 2.0.4, but I'm not seeing it after this fix. Still, I can't help but see that this is related.

          Show
          brianfox brianfox added a comment - Interesting because this is exactly what I was seeing pre 2.0.4, but I'm not seeing it after this fix. Still, I can't help but see that this is related.
          Hide
          Richard van der Hoff added a comment -

          This must be the same issue as MNG-2297, no?

          Show
          Richard van der Hoff added a comment - This must be the same issue as MNG-2297 , no?
          Hide
          Carlos Sanchez added a comment -

          See patch from MNG-2297

          Show
          Carlos Sanchez added a comment - See patch from MNG-2297
          Hide
          John Casey added a comment -

          Added two new unit tests to maven-project:org.apache.maven.project.ModelUtilsTest to verify that merged plugins are no longer added to the child POM twice. Merged plugin definitions were not being cached, and could not be checked before being added a second time to the resulting plugins list (along with plugins that didn't undergo a merge).

          Show
          John Casey added a comment - Added two new unit tests to maven-project:org.apache.maven.project.ModelUtilsTest to verify that merged plugins are no longer added to the child POM twice. Merged plugin definitions were not being cached, and could not be checked before being added a second time to the resulting plugins list (along with plugins that didn't undergo a merge).
          Hide
          Sujan Kapadia added a comment -

          I still see the following issue under Maven 2.0.4:

          In a multi-module project, the parent POM configures the maven-antrun-plugin to declare dependencies for the plugin. In the child POMs, the plugin is being executed twice. The effective POM shows two plugin declarations. Because of MNG-1949, I tried to configure the plugin in the parent POM so all modules executing maven-antrun-plugin would have the necessary dependencies. Can anybody comment on this?

          Thanks,
          Sujan

          Parent POM:
          <build>
          <plugins>
          <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <dependencies>
          <dependency>
          <groupId>ant</groupId>
          <artifactId>ant-nodeps</artifactId>
          <version>1.6.5</version>
          </dependency>
          </dependencies>
          </plugin>
          </plugins>
          </build>

          Show
          Sujan Kapadia added a comment - I still see the following issue under Maven 2.0.4: In a multi-module project, the parent POM configures the maven-antrun-plugin to declare dependencies for the plugin. In the child POMs, the plugin is being executed twice. The effective POM shows two plugin declarations. Because of MNG-1949 , I tried to configure the plugin in the parent POM so all modules executing maven-antrun-plugin would have the necessary dependencies. Can anybody comment on this? Thanks, Sujan Parent POM: <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <dependencies> <dependency> <groupId>ant</groupId> <artifactId>ant-nodeps</artifactId> <version>1.6.5</version> </dependency> </dependencies> </plugin> </plugins> </build>

            People

            • Assignee:
              John Casey
              Reporter:
              Stephen Duncan Jr
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: