Skip to content

Conversation

@sultan
Copy link

@sultan sultan commented Nov 20, 2025

This is a port of apache/maven#929 to maven-resolver
to fix :

intention is:
9.4.1.jre16 > 9.4.1.jre16-preview
1.0.0.RC1 < 1.0.0-RC2
( edr, pfd, etc.) < final, ga, release
following semver rules should be encouraged, natural ordering is used without the need to hard code strings, except for hard coded qualifiers 'a', 'b', 'm', 'cr', 'snapshot', 'final', 'ga', 'release', '' and 'sp':

alpha = a < beta = b < milestone = m < rc = cr < 'snapshot' < '' = 'final' = 'ga' = 'release' < 'sp'
any other qualifier < 'snapshot' < '' = 'final' = 'ga' = 'release' < 'sp'

the documentation should discourage the usage of 'cr', 'final', 'ga', 'release' and 'sp' qualifiers.
Maven Central should begin to reject new artifact that use :

  • 'final', 'ga', 'release' qualifiers, and ask for no qualifiers instead.
  • SP qualifiers, and ask for incremented patch version instead.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@sultan
Copy link
Author

sultan commented Nov 20, 2025

Draft asking for help/reviewer :

What is the intention with this test ?

org.opentest4j.AssertionFailedError: expected ga.ga.foo < foo ==> 
org.opentest4j.AssertionFailedError: expected 1.0.0-ga-foo < 1-foo ==> 
    @Test
    void testEdgeCase_1_2() {
        // as expected
        assertOrder(X_LT_Y, "ga.ga.foo", "foo");
    }

    @Test
    void testEdgeCase_2_1() {
        assertOrder(X_GT_Y, "0.foo.1.2.3", "foo.1.2.3");
        // they were equal in Resolver 1.x
        assertOrder(X_GT_Y, "0.foo", "foo");
        assertOrder(X_EQ_Y, "1.0.0-foo", "1-foo");
        // but "foo" != "ga" (string > qualifier)
        assertOrder(X_LT_Y, "1.0.0-ga-foo", "1-foo");
        assertOrder(X_EQ_Y, "1.0.0-ga-foo", "1-ga-foo");
        assertOrder(X_LT_Y, "1.0.0.final-foo", "1-foo");
        assertOrder(X_EQ_Y, "1.0.0.final-foo", "1-final-foo");
    }

@cstamas
Copy link
Member

cstamas commented Nov 27, 2025

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.

2 participants