Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Version ranges in gradle

What are the possible ways of specifying version ranges in gradle dependencies? I saw some 1.+ notation but I have not found a document which really says what is possible and what is not. Furthermore, I do not know whether the Maven ranges can be used as well.

Can somebody give me a short overview so that I can understand the rules?

like image 975
J Fabian Meier Avatar asked Jan 15 '16 11:01

J Fabian Meier


People also ask

What is version in Gradle?

In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here. Option 2- gradle-wrapper.properties. If you are using the Gradle wrapper, then your project will have a gradle/wrapper/gradle-wrapper.

How do I get the latest version of dependency in Gradle?

You can use the version string “latest. integration” to achieve this. This is a dynamic version that tells Gradle to use the very latest version of a dependency. Note that for a maven repository, this feature requires that the list of all available versions is published in a maven-metadata.

Can I have multiple Gradle versions?

To change that, you need to change the PATH variable. There are also tools like sdkman and similar that can switch between different Gradle versions. But actually you shouldn't really need that, or even need an installed Gradle version, let alone two.


1 Answers

The book "Gradle Dependency Management" states on p. 12 and 13 that, in addition to the +-notation (2.1.+ means the range from 2.1.0 inclusive to 2.2.0 exclusive) you can use the Ivy notation for open and closed intervals of the form

[1.0,2.0]
[1.0,2.0[

or also

[1.0, )

for "all versions starting from 1.0".

like image 56
J Fabian Meier Avatar answered Oct 22 '22 16:10

J Fabian Meier