Comments (21)
A release containing this would be highly appreciated.
from versions.
Sigh, indeed, I keep hoping a fixed version of the plugin will be released, but have been disappointed so far.
from versions.
Hi,
If this can help, here are some example with Maven v3.5.0 and versions plugin v2.4 using the command mvn versions:display-plugin-updates
:
- Using prerequisites triggers a Maven warning but is well understood by the versions plugin.
- Using enforcer works well with Maven but triggers an error with the versions plugin.
pom-prereq.txt
out-prereq.txt
pom-enforcer.txt
out-enforcer.txt
Cheers,
Pablo
from versions.
Confusingly, the plugin even tells me to use the enforcer despite not respecting the setting:
[ERROR] Project does not define required minimum version of Maven.
[ERROR] Update the pom.xml to contain maven-enforcer-plugin to
[ERROR] force the maven version which is needed to build this project.
[ERROR] See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
from versions.
Woohoo! Yeah, I just tried it. I had to add the Maven Enforcer Plugin indicating a minimum Maven version of 3.0.5, but then it worked and I didn't have to use that incorrect <prerequisites>
tag anymore. Thanks so much everyone!!
from versions.
A fix would be very nice as this is very confusing and the output of versions:display-plugin-updates
is basically useless if you use the correct way and enforce the maven version with the enforcer plugin :(
from versions.
@garretwilson It works for me when I use versions-maven-plugin 2.7
.
from versions.
You might try looking at the latest version of our GlobalMentor parent POM I just updated it this morning to fix this problem. We haven't yet released his artifact to Maven Central, so if you find a problem in it let me know! Hopefully it will point you to what you're missing—or indicate something I missed.
from versions.
Another thing to watch out for is that your enforcer execution should have an id of enforce-maven
as mentioned at https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html as opposed to enforce-versions
as mentioned at https://maven.apache.org/enforcer/maven-enforcer-plugin/usage.html. It's unfortunate that the enforcer's own documentation gets it wrong.
from versions.
Interesting, what cares about the id?
from versions.
@brunchboy My understanding of this is a bit fuzzy but going by https://maven.apache.org/guides/mini/guide-default-execution-ids.html each plugin has a default execution id. If you want to override its default configuration (for example, by default the enforcer plugin does nothing) then you must specify the execution id you're trying to override. That way if a user invokes an unrelated task (e.g. mvn clean install
... notice that they didn't explicitly invoke enforcer) then when the enforcer plugin runs it'll use your overridden configuration.
I hope that helps.
from versions.
Is this problem fixed, really?
from versions.
Here is the archived version of that issue page:
https://web.archive.org/web/20150514123930/http://jira.codehaus.org/browse/MVERSIONS-272
from versions.
Yes, it seems that I am now in a damned-if-I-do, damned-if-I-don’t situation. I have added the enforcer plugin, but if I leave the prerequisites stanza in my pom.xml
then I get a warning about it being deprecated when I build, and if I omit it, I get an error when I try to run versions:display-plugin-updates
. Is there a correct answer?
from versions.
The current version (2.3) of versions-maven-plugin does not correctly handle that. The correct way since Maven 3 is to remove the prerequisites for non-plugin projects. But the problem is located in the versions-maven-plugin.
from versions.
Is there a correct answer?
@brunchboy , no, apparently not. @dannil gave a good summary here: #173 (comment)
from versions.
So is this fixed now?
from versions.
@garretwilson I am not having the same luck, I still get the complaints about missing prerequisites even after adding explicit entries for versions-maven-plugin
2.7
and maven-enforcer-plugin
3.0.0-M2
configured to requireMavenVersion
3.0.5
(my Maven version is actually 3.5.4). What am I missing?
from versions.
Thanks, I think the problem was that I was only specifying the versions-maven-plugin
version in the my reporting
plugins section, because the sample configuration XML I had found contained elements that were not valid in the build
section. Adding the plugin itself, without that reporting configuration, seemed to do the trick. But I also noticed you have an entire pluginManagement
section that I lacked, so I added that to specify versions for all the plugins, including some that mvn versions:display-plugin-updates
was complaining had no specified version, and everything seems happy now. Woo hoo! Hopefully I can go back to knowing nothing about Maven for another year or so. 😉
from versions.
Thanks everyone for staying on this! As the originator of this issue, I can report that the fix is working as advertised for me.
from versions.
The plugin documentation wasn't updated and it still talks about "taking care of Maven version prerequisites."
from versions.
Related Issues (20)
- Versions Maven Plugin 2.15.0 ignores allowMajorUpdates flag HOT 1
- Need dependency updates listed to be limited by a restriction on another dependency. HOT 1
- display-plugin-updates shows downgrades HOT 1
- Should detect requireMavenVersion by rules not by id HOT 5
- Support build by JDK 21
- versions:set does behave wrong when parent version is the same as the version to be set
- Show multiple newer versions for each artifact
- ParserNotFoundException on dependency-updates-aggregate-report (2.16.2) HOT 2
- Add a ability to limit versions to Java version
- Disable all reports
- versions:update-parent 2.16.2 not respecting range when allowDowngrade is set to true
- Enhancement: Goal to update plugin versions. HOT 1
- Incorrect implementation of org.codehaus.mojo.versions.CompareDependenciesMojo#getRemoteMavenProject method HOT 1
- maven-jar-plugin update not discovered HOT 2
- Add goal that works with Maven CI Friendly Versions and set property (revision) based on git tag HOT 16
- [feature] EOL tracking with release date of current dependency version HOT 10
- update-properties takes a lot of time for some projects HOT 4
- compare-dependencies does not fail if remotePom is invalid HOT 1
- Can I change an ArtifactId? HOT 1
- parent profile dependency property is not associated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from versions.