Skip to content

Commit

Permalink
mojohaus#299: allowAnyUpdates should be ignored if any of: allowMajor…
Browse files Browse the repository at this point in the history
…Updates, allowMinorUpdates, allowIncrementalUpdates is set to false
  • Loading branch information
andrzejj0 committed Apr 9, 2023
1 parent 426fac7 commit c111aad
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ public class DisplayDependencyUpdatesMojo extends AbstractVersionsDisplayMojo {
private boolean allowIncrementalUpdates = true;

/**
* Whether to allow any version change to be allowed. This keeps
* compatibility with previous versions of the plugin.
* If you set this to false you can control changes in version
* number by {@link #allowMajorUpdates}, {@link #allowMinorUpdates} or
* {@link #allowIncrementalUpdates}.
* <p>Whether to allow any version change to be allowed. This keeps
* compatibility with previous versions of the plugin.</p>
*
* <p><b>Note: Setting any of the: {@linkplain #allowMajorUpdates},
* {@linkplain #allowMinorUpdates}, {@linkplain #allowIncrementalUpdates}
* to {@code false} implies this to be {@code false} as well.</b></p>
*
* @since 2.5
* @deprecated This will be removed with version 3.0.0
Expand Down Expand Up @@ -506,7 +507,7 @@ static void validateGAVList(List<String> gavList, int numSections, String argume
}

private Optional<Segment> calculateUpdateScope() {
return allowAnyUpdates
return allowAnyUpdates && allowMajorUpdates && allowMinorUpdates && allowIncrementalUpdates
? empty()
: of(SegmentUtils.determineUnchangedSegment(
allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates, getLog())
Expand Down
Loading

0 comments on commit c111aad

Please sign in to comment.