Backport #12505: mvnup: widen exact Maven version pins to allow Maven 4#12508
Conversation
…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 <noreply@anthropic.com>
gnodet
left a comment
There was a problem hiding this comment.
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 Please assign appropriate label to PR according to the type of change. |
Summary
maven-4.0.xUPPER_BOUND_BELOW_MAVEN4pattern toEnforcerVersionRangeStrategyto 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)[3.8.6,3.8.6]was blocking Maven 4)🤖 Generated with Claude Code