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

Plugin with ${project.groupId} resolved improperly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.2, 3.6.3
    • Fix Version/s: 3.8.2, 4.0.0, 4.0.0-alpha-1
    • Component/s: None
    • Labels:
      None

      Description

      This is a regression against 3.6.1.

      If a plugin is managed and declared using

      <groupId>${project.groupId}</groupId>
      <artifactId>my-plugin</artifactId>
      <version>${project.version}</version>
      

      then with Maven 3.6.2 the latest version available in the local maven repo is taken instead of ${project.version}

      Steps to reproduce:

      # clone the reproducer
      git clone https://github.com/ppalaga/MNG-6767.git
      cd MNG-6767
      
      # build the master branch using maven 3.6.1 or 3.6.2
      mvn clean install
      # es expected this installed the version 0.0.2 of the groupid-resolution-plugin to the local maven repo
      
      # now let's switch to the 0.0.1.x branch where the version is 0.0.1-SNAPSHOT
      git checkout -b 0.0.1.x origin/0.0.1.x
      
      # make sure you use Maven 3.6.2
      mvn -version
      # Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
      # ...
      
      # build again 
      mvn clean install
      
      # inspect the console output: 
      # EXPECTED 
      # [INFO] --- groupid-resolution-plugin:0.0.1-SNAPSHOT:hello (hello) @ groupid-resolution-jar ---
      # [INFO] Hello from 0.0.1-SNAPSHOT
      # ACTUAL:
      # [INFO] --- groupid-resolution-plugin:0.0.2:hello (hello) @ groupid-resolution-jar ---
      # [INFO] Hello from 0.0.2
      

      If the last build is repeated with Maven 3.6.1, then the output is as expected.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael-o Michael Osipov
                Reporter:
                ppalaga Gazda
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: