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

allow* parameters not working on display-dependency-updates #299

Closed
meeque opened this issue Aug 20, 2018 · 11 comments
Closed

allow* parameters not working on display-dependency-updates #299

meeque opened this issue Aug 20, 2018 · 11 comments
Labels

Comments

@meeque
Copy link

meeque commented Aug 20, 2018

I'm trying to use the versions:display-dependency-updates goal from the CLI, but forbid major updates. I tried both of the following:

mvn versions:display-dependency-updates -DallowAnyUpdates=false -DallowMajorUpdates=false
mvn versions:display-dependency-updates -DallowAnyUpdates=false -DallowMajorUpdates=false -DallowMinorUpdates=true -DallowIncrementalUpdates=true -DallowSnapshots=false

In any case, I'm still seeing outputs like the following:

[INFO]   org.springframework:spring-core .......... 4.3.16.RELEASE -> 5.0.0.RC4

As you can see, the major version changed from 4 to 5, which I would not expect. Instead, was hoping for the following (based on today's versions on Maven Central):

[INFO]   org.springframework:spring-core ..... 4.3.16.RELEASE -> 4.3.18.RELEASE

Sorry, if I'm missing something fundamental, or have a typo in the above. I tried hard to get it right, and rule everything out.

Btw, the above behavior is not limited to that specific dependency. Other dependencies are affected, too. Could this be caused by the weird version suffixes that projects such as Spring and Netty are using?

Fyi, some version information:

[INFO] --- versions-maven-plugin:2.5:display-dependency-updates (default-cli) @ Xyz ---
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00)
Maven home: /usr/local/Cellar/maven/3.5.4/libexec
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"
@meeque
Copy link
Author

meeque commented Aug 20, 2018

Some notes:

@dougbreaux
Copy link

2.5 years on, relatively new to Maven and really wanting & expecting this to work. And the documentation certainly says that it should.

@meeque
Copy link
Author

meeque commented Jan 27, 2021

Thanks for resurfacing this one, @dougbreaux. Frankly, I have accepted that this just does not work as expected a long time ago. In fact, I had forgotten about this completely.

It would still be great to hear feedback from a contributor. Is this considered a bug? Or is it expected behavior? How do we need to adjust our expectations?

If it's a bug, would a PR be welcome? I might have another look at this. But I'm not experienced with developing Maven Plugins. I cannot promise to get it right and would certainly need review and feedback.

mklinger added a commit to mklinger/versions-maven-plugin that referenced this issue Feb 10, 2021
- Removed parameter allowAnyUpdates
- Added parameter allowIncrementalUpdates
- All scope parameters are `true` by default and can be disabled
  independently of other scope parameters.
@mklinger
Copy link

After having the same problem here, I took a look at the source code (thanks for pointing to the relevant places, @meeque). The parameter semantics are not really intuitive. In the current version (2.8.1) they work as follows:

  • With allowAnyUpdates=true (default): The latest version will be displayed, no matter what part of the version number changed. All other allow* parameters are ignored.
  • With allowAnyUpdates=false and allowMajorUpdates=true (default), the latest version with a higher major part will be displayed. Parameters allowMinorUpdates and allowIncrementalUpdates are ignored.
  • With allowAnyUpdates=false and allowMajorUpdates=false and allowMinorUpdates=true (default), the latest version with a higher minor part will be displayed. Versions with higher major parts are ignored. Parameter allowIncrementalUpdates is ignored.
  • With allowAnyUpdates=false and allowMajorUpdates=false and allowMinorUpdates=false and allowIncrementalUpdates=true (default), the latest version with a higher incremental part will be displayed. Versions with higher major parts or higher minor parts are ignored.

IMHO, this doesn't make much sense for semantic versioning. I hacked a version that removes the allowAnyUpdates parameter and allows to set the other parameters independently of each other. With this version, setting allowMajorUpdates=false will display all available updates that do not have a change in the major part.

The fork is available here, in the hope it may be useful: https://github.com/mklinger/versions-maven-plugin

@montss
Copy link

montss commented Mar 20, 2022

This issue is still there as of today on version 2.9

@dmgping
Copy link

dmgping commented Apr 6, 2023

Having problems due to this issue also.

@andrzejj0
Copy link
Contributor

What kind of problems are you experiencing exactly, @dmgping?

allowAnyUpdates has been deprecated and is to be removed in version 3.0.0 of the plugin. Furthermore, the documentation and behaviour has been enriched to specify that e.g. allowMajorUpdates false also implies allowAnyUpdates false.

So, could you please state what dependency updates are not being updated properly and what the pom.xml and the version of the plugin you're using are.

andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Apr 9, 2023
…Updates, allowMinorUpdates, allowIncrementalUpdates is set to false
@dmgping
Copy link

dmgping commented Apr 10, 2023

The problem I am having is exactly as @meeque described in the original issue description, the allowMajorUpdates flag is ignored when passed to the versions:display-dependency-updates goal.
image

The -DallowMajorUpdates=false flag works when used with the versions:use-latest-versions goal, but I was trying to parse the output from versions:display-dependency-updates to trigger an external upgrade testing script, which should not run for major versions.

Maven version: 3.8.1
versions-maven-plugin version: 2.14.2

@andrzejj0
Copy link
Contributor

andrzejj0 commented Apr 10, 2023

I see the semantics of allowAnyUpdates is counter-intuitive.

Please set if to false if you want to also set any of the allow...updates flags.

I've created a PR #941 to ignore "allowAnyUpdates".

@andrzejj0
Copy link
Contributor

Also, please always check against the latest release before reporting a problem.

andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Apr 10, 2023
…e if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
@dmgping
Copy link

dmgping commented Apr 10, 2023

Thank you @ajarmoniuk for the clarification, I see the expected results when also providing the -DallowAnyUpdates=false option.
#941 will surely prevent this confusion in future cases.

andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue Apr 28, 2023
…e if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 21, 2023
…e if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 24, 2023
…sser segments

mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 27, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 31, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
andrzejj0 added a commit to andrzejj0/versions-maven-plugin that referenced this issue May 31, 2023
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
slawekjaranowski pushed a commit that referenced this issue Jun 1, 2023
…esser segments

Resolves #299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants