maven2gradle: Please evaluate the "RELEASE" version keyword at least once


(dasmeta662011 .) #1

The maven2gradle task should evaluate the version keywords such as “RELEASE”, which are provided by maven. E.g. if gradle reads RELEASE, it should look up the current version number and paste it into the generated gradle build script.


(Peter Niederwieser) #2

Why do you think that Gradle should resolve ‘RELEASE’ to a concrete version at the time of conversion? Also, isn’t ‘RELEASE’ a deprecated and discouraged Maven feature?


(dasmeta662011 .) #3

As far as i know, it isn’t deprecated for dependencies (indeed for plugin versions). It might be discouraged in the forums and on stackoverflow, but i think it’s useful for prototyping and checking, what release remains compatible.

Therefore it is a usable feature but somewhat controversial feature, that has it’s use cases (e.g. prototyping).


(Peter Niederwieser) #4

Why should Gradle resolve it to a concrete version then, rather than leaving it at ‘RELEASE’?


(dasmeta662011 .) #5

Because “RELEASE” in a gradle build file results in a build failure.

Proof is that manually replacing it with a valid version solved this.


(Peter Niederwieser) #6

Where exactly does it fail? ‘project.version’ in itself can have any value.


(dasmeta662011 .) #7

In my build.gradle i have a dependency declaration similar to this:

compile group: ‘org.hibernate’, name: ‘hibernate-core’, version: ‘RELEASE’

I get the error “could not find dependency …”

Replacing ‘RELEASE’ with eg ‘3.6.7.Final’ will work as desired.


(kavin kankeshwar) #8

Waking up this thread to figure out a solution,

Sonatype Nexus, Resolves LATEST and RELEASE: https://maven.java.net/nexus-core-documentation-plugin/core/docs/rest.artifact.maven.redirect.html

And this is failing for me too, What i am Trying to do is, Find the latest version of Snashot and Release of a dependency, Cannot use dynamic version, Because i create a metadata file, Which latest can be used by python script, To get artifacts to create a sandbox. So cannot use + etc. From what i know, Nexus API does not support that.

Is there a way, I can just get the version numbers in Gradle for SNAPSHOT and Release and dump that to a file ?