gnodet opened a new pull request, #12073:
URL: https://github.com/apache/maven/pull/12073

   ## Summary
   
   Backport of #12072 to `maven-4.0.x`.
   
   Replace the hand-rolled version comparison in 
`PluginUpgradeStrategy.isVersionBelow()` with `Session.parseVersion()` from 
maven-api, which correctly handles milestone/pre-release qualifiers.
   
   ## Problem
   
   The previous implementation stripped qualifiers before comparison:
   ```java
   String cleanCurrent = currentVersion.split("-")[0]; // "3.0.0-M1" → "3.0.0"
   ```
   
   This caused `isVersionBelow("3.0.0-M1", "3.0.0")` to return `false` — mvnup 
thought `3.0.0-M1` was already sufficient when it's actually a pre-release 
below `3.0.0`.
   
   This affected 19 projects in maven4-testing (16 flink-connectors + 3 sling 
projects) using `maven-enforcer-plugin:3.0.0-M1`, which is incompatible with 
Maven 4.
   
   ## Fix
   
   Use `Session.parseVersion()` from maven-api which returns a 
`Comparable<Version>` that correctly handles all version qualifier semantics:
   - `3.0.0-M1 < 3.0.0` ✓
   - `3.0.0-alpha-1 < 3.0.0` ✓
   - `3.0.0-RC1 < 3.0.0` ✓
   - `3.0.0-SNAPSHOT < 3.0.0` ✓
   
   ## Test plan
   
   - [x] All existing tests pass (22/22)
   - [x] New test: `shouldUpgradeMilestoneVersionBelowRelease` — verifies 
`3.0.0-M1` is upgraded to `3.0.0`
   
   _Claude Code on behalf of Guillaume Nodet_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to