Maven versions release candidates and snapshot

My goal is to release a project that has one dependency. I have a nexus repository in which I deploy both snapshots and release versions.

One addiction I have has

group:artifact:1.1.0-SNAPSHOT

and the next release release is released in my nexus registry

group:artifact:1.1.0-RC1

when requesting the version plugin to resolve dependencies, it claims that no new dependency exists. Therefore, he believes that

1.1.0-SNAPSHOT > 1.1.0-RC1

However, if in my project I have version 1.0.0-SNAPSHOT, version 1.1.0-RC1 is allowed as the newest version.

What am I missing? (I looked into the sources of the plugin, and we have the following snippet:

String otherQualifier = otherVersion.getQualifier();

if ( otherQualifier != null )
{
  if ( ( qualifier.length() > otherQualifier.length() )
      && qualifier.startsWith( otherQualifier ) )
  {
    // here, the longer one that otherwise match is considered older
    result = -1;
  }
  else if ( ( qualifier.length() < otherQualifier.length() )
      && otherQualifier.startsWith( qualifier ) )
  {
    // here, the longer one that otherwise match is considered older
    result = 1;
  }
  else
  {
    result = qualifier.compareTo( otherQualifier );
  }
}

which seems to me a mistake. Any idea?

+5
source share
2 answers

Maven :

<major version>.<minor version>.<incremental version>-<qualifier>

, . "RC1" "SNAPSHOT" - "a" "b". "SNAPSHOT" , . . .

, a.b.c-RC1-SNAPSHOT a.b.c-RC1.

, - , Maven.

+9

major.minor.increment-qualifier lexigographic , .

maven-versions-plugin , , , .

,

org/codehaus/mojo/versions/ordering/MavenVersionComparator 

org/codehaus/mojo/versions/ordering/VersionComparators.java

-

+1

All Articles