Wrong version comparison for Maven affecting Spring

See full description of the problem - in short, resolving dependencies on Spring Framework placed in a Maven repository is incorrect, resulting in 4.2.0.RELEASE being considered an earlier version than 4.2.0.RC3.

To reproduce:

repositories {
    jcenter()
}

dependencies {
    compile(group: 'org.springframework', name: 'spring-core', version:'4.2.+')
}

Logs from gradle dependencies --refresh-dependencies --configuration compile --debug:

13:37:14.673 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency :gradle-idea-test-resources:unspecified(compile) -> org.springframework:spring-core:4.2.+(compile)
13:37:14.674 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for org.springframework:spring-core:4.2.+ using repositories [BintrayJCenter]
13:37:14.682 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: https://jcenter.bintray.com/org/springframework/spring-core/maven-metadata.xml
13:37:14.865 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.MavenMetadataLoader] parsing maven-metadata: org.gradle.internal.resource.transfer.DefaultExternalResource@22d9ca63
13:37:14.867 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResponseResource] Attempting to download resource https://jcenter.bintray.com/org/springframework/spring-core/maven-metadata.xml.
13:37:14.872 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection released: [id: 0][route: {s}->https://jcenter.bintray.com][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
13:37:14.873 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.dynamicversions.SingleFileBackedModuleVersionsCache] Caching version list in module versions cache: Using '[1.0-rc1, 1.0, 1.0.1, 1.1-rc1, 1.1-rc2, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2-rc1, 1.2-rc2, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 2.0-m1, 2.0-m2, 2.0-m3, 2.0-m4, 2.0-m5, 2.0-rc1, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.6.SEC01, 2.5.6.SEC02, 2.5.6.SEC03, 2.5.6.SEC03-atlassian-2, 2.5.6.SEC03-atlassian-6, 3.0.0.M3, 3.0.0.M4, 3.0.0.RC1, 3.0.0.RC2, 3.0.0.RC3, 3.0.0.RELEASE, 3.0.1.RELEASE, 3.0.2.RELEASE, 3.0.3.RELEASE, 3.0.4.RELEASE, 3.0.5.RELEASE, 3.0.6.RELEASE, 3.0.7.RELEASE, 3.1.0.M1, 3.1.0.M2, 3.1.0.RC1, 3.1.0.RC2, 3.1.0.RELEASE, 3.1.1.RELEASE, 3.1.2.RELEASE, 3.1.3.RELEASE, 3.1.4.RELEASE, 3.2.0.M1, 3.2.0.M2, 3.2.0.RC1, 3.2.0.RC2, 3.2.0.BUILD, 3.2.0.RELEASE, 3.2.1.RELEASE, 3.2.2.RELEASE, 3.2.3.RELEASE, 3.2.4.RELEASE, 3.2.5.RELEASE, 3.2.6.RELEASE, 3.2.7.RELEASE, 3.2.8.RELEASE, 3.2.9.RELEASE, 3.2.10.RELEASE, 3.2.11.RELEASE, 3.2.12.RELEASE, 3.2.13.RELEASE, 3.2.14.RELEASE, 4.0.0.M1, 4.0.0.M2, 4.0.0.M3, 4.0.0.RC1, 4.0.0.RC2, 4.0.0.RELEASE, 4.0.1.RELEASE, 4.0.2.RELEASE, 4.0.3.RELEASE, 4.0.4.RELEASE, 4.0.5.RELEASE, 4.0.6.RELEASE, 4.0.7.RELEASE, 4.0.8.RELEASE, 4.0.9.RELEASE, 4.1.0.RC1, 4.1.0.RC2, 4.1.0.RELEASE, 4.1.1.RELEASE, 4.1.2.RELEASE, 4.1.3.RELEASE, 4.1.4.RELEASE, 4.1.5.RELEASE, 4.1.6.RELEASE, 4.1.7.RELEASE, 4.2.0.RC1, 4.2.0.RC2, 4.2.0.RC3, 4.2.0.RELEASE]' for 'org.springframework:spring-core'
13:37:14.884 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.IvyXmlModuleDescriptorParser] post 1.3 ivy file: using exact as default matcher
13:37:14.885 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Cached meta-data for module must be refreshed: will perform fresh resolve of 'org.springframework:spring-core:4.2.0.RC3' in 'BintrayJCenter'

Thanks for the report. Gradle has a very limited set of special suffixes that it recognises: ‘RC’ one but ‘RELEASE’ is not, which is why ‘RC’ places after ‘RELEASE’.

This is something we could fix: I’ve raised the possibility on the dev list.