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

[regression] Plugins are not properly ordered after merging with inherited parent plugins

    XMLWordPrintableJSON

Details

    Description

      For a parent POM with

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.its.plugins</groupId>
            <artifactId>maven-it-plugin-b</artifactId>
            <version>2.1-SNAPSHOT</version>
          </plugin>
        </plugins>
      </build>
      

      and a child POM with

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.its.plugins</groupId>
            <artifactId>maven-it-plugin-a</artifactId>
            <version>2.1-SNAPSHOT</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.its.plugins</groupId>
            <artifactId>maven-it-plugin-b</artifactId>
            <version>2.1-SNAPSHOT</version>
          </plugin>
        </plugins>
      </build>
      

      the child's effective model will end up like this in 3.x:

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.its.plugins</groupId>
            <artifactId>maven-it-plugin-b</artifactId>
            <version>2.1-SNAPSHOT</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.its.plugins</groupId>
            <artifactId>maven-it-plugin-a</artifactId>
            <version>2.1-SNAPSHOT</version>
          </plugin>
        </plugins>
      </build>
      

      i.e. plugin-a comes after plugin-b although it should be the order declared in the POM.

      In general, inheritance is expected to respect the following ordering during plugin merging:

      parent: X -> A -> B -> D -> E
      child:  Y -> A -> C -> D -> F
      result: X -> Y -> A -> B -> C -> D -> E -> F
      

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              dbradicich Damian Bradicich
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: