Revert "Revert "Use new implementation of Maven version standard"" #10704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #10647
What are you trying to accomplish?
Update Maven to use the newly implemented maven version standard: #10524
I added a new implementation of the maven version standard in PR #10524. However, to reduce the size of that PR I decided to create a separate PR where I can integrate the new version implementation.
Fixes incorrect version precedence and adds extra tests for version comparisons.
Anything you want to highlight for special attention from reviewers?
The maven spec: https://maven.apache.org/pom.html#version-order-specification is not 100% compatible with the implementation we had before. For example, in the previous implementation, any versions with qualifiers like 'pr', 'pre' or 'dev' were considered prereleases. The maven spec only mentions "alpha", "beta", "milestone", "rc", "cr" and "snapshot" as having lower precedence than ("" | final | ga) i.e. as potential prereleases.
In my view, it's better to strictly follow the spec since standardising is one of our goals. Therefore, I have removed the other tokens from the previous implementation that were being treated as prereleases. However, this could be a breaking change for some users who might expect versions like 1.2.dev to have lower precedence than 1.2.dev, for example.
I've also had to remove some code and update tests to do with dynamic versioning e.g 2.+. This is a gradle feature that the maven specification doesn't support.
Finally, in order to test the new implementation thoroughly, I've grouped similar test inputs together and I loop through these lists to avoid having to manually type in the test cases individually. Inevitably, that's coming up as a huge diff in the test files.