-- DISCUSSION --
MNG-6562 introduced the warning :
"Version not locked for default bindings plugins [maven-clean-plugin,
maven-resources-plugin, maven-compiler-plugin, maven-surefire-plugin,
maven-jar-plugin, maven-install-plugin], you should define versions in
pluginManagement section of your pom.xml or parent."
The warning was added before the Maven Wrapper became popular. For a
project that uses Maven Wrapper the warning does not make sense to me:
those plugin versions are indeed de-facto locked. Right? The build is
already reproducible and will always yield the same result regardless on
which platform it is executed. (We must assume that users are aware that
IF a project contains a Maven Wrapper then it is because you are
supposed to use it! (i.e. execute 'mvnw' , not 'mvn')).
The warning leads to the user rushing to extend/complicate his POM while
this is unnecessary when using the wrapper. I believe the "lock" between
a specific Maven version (e.g. v3.9.2) and its default plugin versions
is something that to the user should be equally good as adding that long
list of dependencies to the POM. I get it that we want to educate users
that Maven is "a collection of plugins" but in reality users see the
Maven version as a CURATED set of plugin dependencies. Which indeed it
is, right?
My suggestion is to not print this warning if the build is being
executed by the Maven Wrapper. I don't know if this possible, i.e.
detecting that mvn is being executed by the wrapper?
Spitballing : Also, the POM could have some kind of setting to signal to
Maven that it MUST be executed via the wrapper. Or at least that is is
INTENDED to be executed using the wrapper. Then Maven could execute a
warning(or fail) if that is not the case.
Alternatively: extend the warning message:
"If you have de-facto locked the Maven version, for example by using the
Maven Wrapper, then you can ignore this warning."
WDYT?
/Lars
PS : As it may be obvious, I'm a great fan of the Wrapper and I believe
it should be advocated more and projects should have a very good reason
NOT to use it. Luckily, many project initializers add it by default
(e.g. Spring Initializr) but the Maven Project itself doesn't make that
much out of it.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org