Giter Club home page Giter Club logo

Comments (21)

PascalSchumacher avatar PascalSchumacher commented on July 24, 2024 11

A release containing this would be highly appreciated.

from versions.

brunchboy avatar brunchboy commented on July 24, 2024 8

Sigh, indeed, I keep hoping a fixed version of the plugin will be released, but have been disappointed so far.

from versions.

ptamarit avatar ptamarit commented on July 24, 2024 5

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.

adamvoss avatar adamvoss commented on July 24, 2024 2

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.

garretwilson avatar garretwilson commented on July 24, 2024 2

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.

PascalSchumacher avatar PascalSchumacher commented on July 24, 2024 1

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.

PascalSchumacher avatar PascalSchumacher commented on July 24, 2024 1

@garretwilson It works for me when I use versions-maven-plugin 2.7.

from versions.

garretwilson avatar garretwilson commented on July 24, 2024 1

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.

cowwoc avatar cowwoc commented on July 24, 2024 1

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.

brunchboy avatar brunchboy commented on July 24, 2024 1

Interesting, what cares about the id?

from versions.

cowwoc avatar cowwoc commented on July 24, 2024 1

@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.

onacit avatar onacit commented on July 24, 2024 1

Is this problem fixed, really?

from versions.

informatik01 avatar informatik01 commented on July 24, 2024

Here is the archived version of that issue page:
https://web.archive.org/web/20150514123930/http://jira.codehaus.org/browse/MVERSIONS-272

from versions.

brunchboy avatar brunchboy commented on July 24, 2024

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.

khmarbaise avatar khmarbaise commented on July 24, 2024

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.

garretwilson avatar garretwilson commented on July 24, 2024

Is there a correct answer?

@brunchboy , no, apparently not. @dannil gave a good summary here: #173 (comment)

from versions.

garretwilson avatar garretwilson commented on July 24, 2024

So is this fixed now?

from versions.

brunchboy avatar brunchboy commented on July 24, 2024

@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.

brunchboy avatar brunchboy commented on July 24, 2024

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.

caseboltj avatar caseboltj commented on July 24, 2024

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.

jakub-bochenski avatar jakub-bochenski commented on July 24, 2024

The plugin documentation wasn't updated and it still talks about "taking care of Maven version prerequisites."

from versions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.