Skip to content

Backport #12505: mvnup: widen exact Maven version pins to allow Maven 4#12508

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:backport/12505-mvnup-exact-version-pin
Jul 20, 2026
Merged

Backport #12505: mvnup: widen exact Maven version pins to allow Maven 4#12508
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:backport/12505-mvnup-exact-version-pin

Conversation

@gnodet

@gnodet gnodet commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Backport of fix: mvnup: widen exact Maven version pins to allow Maven 4 #12505 to maven-4.0.x
  • Adds UPPER_BOUND_BELOW_MAVEN4 pattern to EnforcerVersionRangeStrategy to handle exact version pins like [3.8.6,3.8.6] and sub-4 upper bounds like [3.8.0,3.9), widening them to [lower,5)
  • Fixes Apache Flink compatibility (RequireMavenVersion [3.8.6,3.8.6] was blocking Maven 4)

🤖 Generated with Claude Code

…2505)

Projects like Apache Flink pin their Maven version to an exact version
using ranges like [3.8.6,3.8.6] (both bounds equal, both inclusive).
The existing MAVEN4_EXCLUSIVE_UPPER_BOUND pattern only matched ranges
with an exclusive upper bound at 4.x (e.g. [3.8.8,4)), so exact pins
and ranges with an upper bound below 4 were silently skipped.

Add a new UPPER_BOUND_BELOW_MAVEN4 pattern that catches any version
range whose upper bound has a major version less than 4. This covers:
- Exact version pins: [3.8.6,3.8.6] -> [3.8.6,5)
- Sub-4 upper bounds: [3.8.0,3.9) -> [3.8.0,5)
- Unbounded lower ranges: (,3.9] -> (,5)

Co-authored-by: Claude Opus 4.6 <[email protected]>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Backport #12505 to maven-4.0.x

Clean cherry-pick of #12505 — diff is identical. The EnforcerVersionRangeStrategy changes and all 6 tests apply cleanly to maven-4.0.x.

Same assessment as the master PR: correct regex design, safe getMajorVersion fallback, comprehensive test coverage including integration test for exact version pins in enforcer configuration.

Real-world impact: fixes Apache Flink compatibility where RequireMavenVersion [3.8.6,3.8.6] was blocking Maven 4.

CI: initial-build pending (just started). Code is identical to #12505 which passed all CI.

LGTM.


Reviewed with Claude Code on behalf of Guillaume Nodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@gnodet
gnodet merged commit c6d4fe9 into apache:maven-4.0.x Jul 20, 2026
22 checks passed
@github-actions

Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

@github-actions github-actions Bot added this to the 4.0.0-rc-6 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant