You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/01/07 18:35:00 UTC

[jira] [Updated] (MNG-5974) ComparableVersion fails with semver.org-style milestone versions

     [ https://issues.apache.org/jira/browse/MNG-5974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov updated MNG-5974:
--------------------------------
    Fix Version/s: waiting-for-feedback
                       (was: 4.x / Backlog)

> ComparableVersion fails with semver.org-style milestone versions
> ----------------------------------------------------------------
>
>                 Key: MNG-5974
>                 URL: https://issues.apache.org/jira/browse/MNG-5974
>             Project: Maven
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.3.9
>            Reporter: Tuure Laurinolli
>            Priority: Major
>             Fix For: waiting-for-feedback
>
>
> ComparableVersion does not correctly parse semver.org-style milestone versions where the "m" is separated from the milestyne number by a dot, like "1.0.0-m.3".
> It seems that Maven only recognizes the "m" alias for "milestone" if it's immediately followed by a digit. I don't think this is according to the class javadoc, which does not mention that some aliases require the alias to be followed by a number to be effective.
> Test case:
> {code}
> import org.apache.maven.artifact.versioning.ComparableVersion;
> import org.junit.Test;
> import static org.junit.Assert.assertTrue;
> public class VersionTest {
>     @Test
>     public void testSortVersions() throws Exception {
>         final ComparableVersion m2 = new ComparableVersion("1.2.3-m.2");
>         final ComparableVersion rc1 = new ComparableVersion("1.2.3-rc.1");
>         assertTrue(rc1.compareTo(m2) > 0);
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)