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

Inherited plugin executed twice if child pom merges configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.4
    • None
    • None

    Description

      According the docs the configuration of a plugin is merged, when the plugin is inherited. This actually hapens, but the plugin with the merged configuration is added twice in the effective-pom and therefore executed twice.

      Setup a parent pom with a plugin configuration to attach the javadocs:

                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-javadoc-plugin</artifactId>
                      <executions>
                          <execution>
                              <id>attach-javadocs</id>
                              <goals>
                                  <goal>jar</goal>
                              </goals>
                          </execution>
                      </executions>
                      <inherited>true</inherited>
                      <configuration>
                          <linksource>true</linksource>
                      </configuration>
                  </plugin>
      

      and a child pom that adds additional elements in the configuration:

                 <plugin>
                      <artifactId>maven-javadoc-plugin</artifactId>
                      <configuration>
                          <links>
                              <link>http://java.sun.com/j2se/1.4.2/docs/api/</link>
                              <link>http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/apidocs/</link>
                              <link>http://jmock.codehaus.org/docs/javadoc/</link>
                              <link>http://www.junit.org/junit/javadoc/3.8.1/</link>
                          </links>
                      </configuration>
                  </plugin>
      

      In this case the javadoc is generated twice, the goal help:effective-pom reveals, that the plugin was merged, but added twice.

      Attachments

        Issue Links

          Activity

            People

              carlos Carlos Sanchez Gonzalez
              joehni Joerg Schaible
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: