versions icon indicating copy to clipboard operation
versions copied to clipboard

IMPROVEMENT - allowMinorUpdates=false should imply allowMajorUpdates=false

Open solter opened this issue 6 years ago • 2 comments

I have attached a zip file mvnVersionsIssues.zip sufficient for creating a minimal working example of this bug. It contains two mvn projects, dots1 and dots2, where dots2 depends on dots1.

Here is a complete list of dots1 versions that I have created via modifying the version declaration in the pom and running mvn install without any other changes:

  • 3.0.0-0
  • 2.1.1-1
  • 2.1.0-1
  • 2.1.0-0
  • 2.0.1-1
  • 2.0.1-0
  • 2.0.0-11

when dots2 depends on dots1 version 2.0.0-11, and I run the command $ mvn -DallowMinorUpdates=false versions:use-latest-versions the dots1 dependency updates to version 3.0.0-0 Whereias if I run $ mvn -DallowMajorUpdates=false -DallowMinorUpdates=false versions:use-latest-versions then the dots1 dependency correctly updates to version 2.0.1-1

Ideally both commands yield the same update to version 2.0.1-1

solter avatar May 30 '18 16:05 solter

i think this might be solved with this

https://github.com/mojohaus/versions-maven-plugin/issues/274

jdileonardo avatar Jun 14 '18 19:06 jdileonardo

Linking https://github.com/mojohaus/versions-maven-plugin/issues/243

nsidhaye avatar Sep 05 '18 20:09 nsidhaye

I think it's a bug and not an enhancement. These allow...updates flags are not orthogonal, but indeed imply themselves. And while it's theoretically possible to e.g. only allow major updates, but not minor updates, it would be highly unintuitive to e.g. only allow updates from 1.1.x to 2.1.x.

jarmoniuk avatar Oct 07 '22 13:10 jarmoniuk