Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin should print an excplicit error message if the maven version is lower than the 3.2.5 #866

Closed
andrzejj0 opened this issue Dec 19, 2022 · 12 comments · Fixed by #867
Labels
Milestone

Comments

@andrzejj0
Copy link
Contributor

There's too many confused users reporting guice errors raised because the new components cannot be resolved. I think returning an error message could clear the confusion a bit.

@pzygielo
Copy link
Contributor

I'm shocked this plugin is not using https://maven.apache.org/pom.html#Prerequisites!

@pzygielo
Copy link
Contributor

2.13.0 - has it.

@andrzejj0
Copy link
Contributor Author

2.13.0 - has it.

If it does, how come there are so many users running an older version of maven and reporting errors only now once they upgraded to 2.14.0?

@pzygielo
Copy link
Contributor

80bf105 - plugin w/o prereq
c9c1396 - prereq removed from top-parent

2.11.0/versions-maven-plugin-2.11.0.pom:    <mavenVersion>3.0.5</mavenVersion>
2.12.0/versions-maven-plugin-2.12.0.pom:    <mavenVersion>3.2.5</mavenVersion>

andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Dec 19, 2022
@andrzejj0
Copy link
Contributor Author

Anyway, thanks. I was going for a check using RuntimeInformation 🤡

@pzygielo
Copy link
Contributor

If it does, how come there are so many users running an older version of maven and reporting errors only now once they upgraded to 2.14.0?

I don't know. They lie?

apache-maven-3.0.5:

[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.12.0:help (default-cli) on project standalone-pom: The plugin org.codehaus.mojo:versions-maven-plugin:2.12.0 requires Maven version 3.2.5 -> [Help 1]
[INFO] --- versions-maven-plugin:2.14.0:help (default-cli) @ standalone-pom ---
[INFO] Versions Maven Plugin 2.14.0
  The Versions Maven Plugin is used when you want to manage the versions of
  artifacts in a project's POM.

This plugin has 35 goals:

versions:commit

This shows - that prerequisite IS BEING checked by maven, even so old as 3.0.5, as long as plugin declares it.
2.14.0 doesn't - and :help is executing fine (as doesn't need much more from maven 3.2.5).

@andrzejj0
Copy link
Contributor Author

Checked with 3.2.1 to the same results. I guess they probably moved from a version which did not feature that thing in pom.xml.

@andrzejj0
Copy link
Contributor Author

Anyhoo, it does the job.

andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Dec 19, 2022
@slawekjaranowski slawekjaranowski added this to the 2.14.2 milestone Dec 19, 2022
@slawekjaranowski
Copy link
Member

It was disappeared somehow during split project to modules 😄

Some time ago I have an idea ... https://issues.apache.org/jira/browse/MPLUGIN-418
I see that should be implemented

@slawekjaranowski slawekjaranowski linked a pull request Dec 19, 2022 that will close this issue
@slawekjaranowski
Copy link
Member

80bf105 - plugin w/o prereq c9c1396 - prereq removed from top-parent

2.11.0/versions-maven-plugin-2.11.0.pom:    <mavenVersion>3.0.5</mavenVersion>
2.12.0/versions-maven-plugin-2.12.0.pom:    <mavenVersion>3.2.5</mavenVersion>

so I removed prerequisites from parent and forgot add to plugin module ... You do not have to thank me 😕

@andrzejj0
Copy link
Contributor Author

Happens to the best 😉

@pzygielo
Copy link
Contributor

80bf105 - plugin w/o prereq c9c1396 - prereq removed from top-parent

2.11.0/versions-maven-plugin-2.11.0.pom:    <mavenVersion>3.0.5</mavenVersion>
2.12.0/versions-maven-plugin-2.12.0.pom:    <mavenVersion>3.2.5</mavenVersion>

so I removed prerequisites from parent and forgot add to plugin module

This was not helping anyway.
Note (from MPLUGIN-418):

The failure message should add a hint that the prerequisites element is not inherited (https://maven.apache.org/ref/3.8.6/maven-model-builder/#inheritance-assembly). This is a common case for this error.

So it was missed on plugin module creation in first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants