mojohaus / versions

Versions Maven Plugin
https://www.mojohaus.org/versions/versions-maven-plugin/
Apache License 2.0
328 stars 266 forks source link

Bug: prerequisites are not detected #990

Closed cstamas closed 10 months ago

cstamas commented 11 months ago

When doing versions:display-plugin-updates on this module https://github.com/maveniverse/mima/tree/75a06a1132103506614b33a2cba2229923e86260/demo/library-maven-plugin

I get this message:

[INFO] --------< eu.maveniverse.maven.mima.demo:library-maven-plugin >---------
[INFO] Building eu.maveniverse.maven.mima.demo:library-maven-plugin 1.0.0-SNAPSHOT [5/5]
[INFO]   from library-maven-plugin/pom.xml
[INFO] ----------------------------[ maven-plugin ]----------------------------
[INFO] 
[INFO] --- versions:2.16.0:display-plugin-updates (default-cli) @ library-maven-plugin ---
[INFO] 
[INFO] All plugins with a version specified are using the latest versions.
[INFO] 
[INFO] All plugins have a version specified.
[INFO] 
[WARNING] Project does not define minimum Maven version required for build, default is: 3.2.5
[INFO] Plugins require minimum Maven version of: 3.2.5
[INFO] 
[WARNING] Project (which is a Maven plugin) does not define required minimum version of Maven.
[WARNING] Update the pom.xml to contain
[WARNING]     <prerequisites>
[WARNING]       <maven><!-- minimum version of Maven that the plugin works with --></maven>
[WARNING]     </prerequisites>
[WARNING] To build this plugin you need at least Maven 3.2.5
[WARNING] A Maven Enforcer rule can be used to enforce this if you have not already set one up
[WARNING] See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html

But https://github.com/maveniverse/mima/blob/75a06a1132103506614b33a2cba2229923e86260/demo/library-maven-plugin/pom.xml#L46-L48

While true, I have no enforcer to enforce build time Maven version.

Still, why does plugin claim I have no prerequisites, while I do?

slawekjaranowski commented 11 months ago

prerequisites is only used to define minimum Maven version required by plugin in run-time. IMHO it does not have impact of required Maven version in build time - even it is Maven plugin project.

So message should be the same with info about missing enforcer configuration regardless of the type of project packaging.

jarmoniuk commented 11 months ago

Is that correct that prerequisites can now also be used for non-plugin projects to specify the required maven version? Thus the distinction between plugin- and non-plugin projects in DisplayPluginUpdates should not be there anymore for establishing the version requirement for a POM?