Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-334

Regression: pluginVersions in Parent-POM pluginManagement not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.0.0-M2
    • None
    • Plugin
    • None
    • Maven 3.6.1, Ubuntu 18.04 LTS, Oracle JDK 1.8.0_181

    Description

      The enforcer plugin no longer accepts versions defined in a parent POMs pluginManagement section.

      In the example project attached you will find two pom.xml files. The one in the parent directory is to be installed/deployed into the repository and then to be used as parent POM in the project stub of the project directory.

      If the parent defines version 1.4.1 for the maven-enforcer-plugin, everything works as expected (i.e. when running "mvn validate" in the "project" directory validation succeeds), when the parent defines version 3.0.0-M2, validation fails with:

      [INFO] — maven-enforcer-plugin:3.0.0-M2:enforce (default) @ project —
      [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequirePluginVersions failed with message:
      Some plugins are missing valid versions:(LATEST RELEASE SNAPSHOT are not allowed )
      org.apache.maven.plugins:maven-compiler-plugin. The version currently in use is 3.8.1
      org.apache.maven.plugins:maven-surefire-plugin. The version currently in use is 3.0.0-M3
      org.apache.maven.plugins:maven-jar-plugin. The version currently in use is 3.1.2
      org.apache.maven.plugins:maven-clean-plugin. The version currently in use is 3.1.0
      org.apache.maven.plugins:maven-install-plugin. The version currently in use is 3.0.0-M1
      org.apache.maven.plugins:maven-site-plugin. The version currently in use is 3.7.1
      org.apache.maven.plugins:maven-resources-plugin. The version currently in use is 3.1.0
      org.apache.maven.plugins:maven-deploy-plugin. The version currently in use is 3.0.0-M1
      org.apache.maven.plugins:maven-enforcer-plugin. The version currently in use is 3.0.0-M2
      Best Practice is to always define plugin versions!

      even though these versions have been defined in the pluginManagement section of the parent.

      Attachments

        1. enforcer-regression.zip
          2 kB
          Wolf Geldmacher

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              wjg57 Wolf Geldmacher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: