|
Hi, mvn versions:display-plugin-updates presently prints a [WARNING] for any plugin that does not explicitly declare a version within the very pom that it is declared, in particular these three cases:
1.) The version # is declared in a parent-level pom via <pluginManagement/>
2.) The version # is declared in the super pom
3.) The version # could not be found/determined anywhere, i.e., it's unknown.
Printing out error messages for (3) should be retained obviously, also (2) because Maven discourages relying on Maven version-dependent super pom version #s in order to guarantee identical builds. But I don't see the need to report (1) as it's a fine best practice to use <pluginManagement/> in parent POMs to define versions. (Just like mvn versions:display-dependency-updates doesn't output any warnings should one use <dependencyManagment/> sections to declare versions.)
This issue can be seen when running this goal against the following pom.xml: https://github.com/gmazza/blog-samples/blob/master/ssl_for_web_services/service/pom.xml, where this goal complains about unspecified versions for all three plugins declared within it, even though their versions are properly defined in the <pluginManagement/> section in this parent pom: https://github.com/gmazza/blog-samples/blob/master/ssl_for_web_services/pom.xml. Output:
[INFO] ------------------------------------------------------------------------
[INFO] Building – Web Service Provider 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — versions-maven-plugin:3.0-SNAPSHOT:display-plugin-updates (default-cli) @ ssl-for-web-services-service —
[INFO]
[INFO] All plugins with a version specified are using the latest versions.
[INFO]
[WARNING] The following plugins do not have their version specified:
[WARNING] org.apache.cxf:cxf-codegen-plugin .......................... 2.7.1
[WARNING] org.apache.felix:maven-bundle-plugin ....................... 2.3.7
[WARNING] maven-clean-plugin .......................... (from super-pom) 2.5
[WARNING] maven-compiler-plugin ....................... (from super-pom) 3.0
[WARNING] maven-deploy-plugin ......................... (from super-pom) 2.7
[WARNING] maven-install-plugin ........................ (from super-pom) 2.4
[WARNING] maven-jar-plugin ............................ (from super-pom) 2.4
[WARNING] maven-resources-plugin ...................... (from super-pom) 2.6
[WARNING] maven-site-plugin ........................... (from super-pom) 3.2
[WARNING] maven-surefire-plugin .................... (from super-pom) 2.12.4
[WARNING] org.jvnet.jax-ws-commons:jaxws-maven-plugin .................. 2.2
[INFO]
Attached patch against 3.0-SNAPSHOT (trunk) will no longer report unspecified plugin version warning if their declaration is in a parent-level <pluginManagment/> sections, i.e., the new output for the above pom will now just be:
[WARNING] The following plugins do not have their version specified:
[WARNING] maven-clean-plugin .......................... (from super-pom) 2.5
[WARNING] maven-compiler-plugin ....................... (from super-pom) 3.0
[WARNING] maven-deploy-plugin ......................... (from super-pom) 2.7
[WARNING] maven-install-plugin ........................ (from super-pom) 2.4
[WARNING] maven-jar-plugin ............................ (from super-pom) 2.4
[WARNING] maven-resources-plugin ...................... (from super-pom) 2.6
[WARNING] maven-site-plugin ........................... (from super-pom) 3.2
[WARNING] maven-surefire-plugin .................... (from super-pom) 2.12.4
Test case: the source code above can be checked out from GitHub, and the before-and-after output can be confirmed via running mvn org.codehaus.mojo:versions-maven-plugin:3.0-SNAPSHOT:display-plugin-updates before-and-after applying the patch.
|