Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-2591

Plugins are merged incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.4
    • 2.0.8
    • None
    • None
    • Windows XP

    Description

      This bug is similar to http://jira.codehaus.org/browse/MANTRUN-57;jsessionid=awtyLFBPEQN6vVmwu4 - the difference being the plugins are not correctly merged.

      In the parent's POM, the following was defined:

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-eclipse-plugin</artifactId>
              <configuration>
                <downloadSources>true</downloadSources>
                <additionalBuildcommands>
                  <buildcommand>
                    parentBuildCommand
                  </buildcommand>
                </additionalBuildcommands>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>

      in the child's POM, the following was defined.

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-eclipse-plugin</artifactId>
              <configuration>
                <additionalBuildcommands>
                  <buildcommand>
                    childBuildCommand
                  </buildcommand>
                </additionalBuildcommands>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>

      I expect the effective POM to look like this:

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-eclipse-plugin</artifactId>
              <configuration>
                <additionalBuildcommands>
                  <buildcommand>
                    parentBuildCommand
                  </buildcommand>
                  <buildcommand>
                    childBuildCommand
                  </buildcommand>
                </additionalBuildcommands>
                <downloadSources>true</downloadSources>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>

      Outside of the common problem of the <plugin> element being duplicated, here's the issue this bug is trying to address:
      In the effective pom, the the <downloadSources> element was correctly merged, however, the <buildCommand> element was not. It seems like the merging only correctly happens down to a given level.

      I noticed that http://jira.codehaus.org/browse/MNG-2297;jsessionid=awtyLFBPEQN6vVmwu4 has a patch attached, so this may be fixed in 2.0.5, I just wanted to raise the use case in case that patch did not address this specific problem.

      I'm attaching the POMs needed to reproduce the problem and the effective POM for the child.

      Attachments

        1. effective-child-pom.xml
          4 kB
          Allan Shoup
        2. test-poms.zip
          1 kB
          Allan Shoup

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              9gaqfk802@sneakemail.com Allan Shoup
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: