Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle: find resolved version of a dependency imported with +

Tags:

I want to print the last version of a dependency in gradle.

I added my dependency in this way :

compile 'test:test:+' 

now I want to print the version of my dependency, because I want to know which version I'm using.

I'm using it in this way :

gradle dependencyInsight --configuration compile --dependency test:test 

But my output is this :

+--- test:test:+ -> project : (*) 

Is there anyway I can get the real version of my dependency and not the +?

like image 683
Daniel Taub Avatar asked Feb 04 '18 16:02

Daniel Taub


People also ask

How does Gradle resolve transitive dependencies?

Releases of a module hosted on a repository can provide metadata to declare those transitive dependencies. By default, Gradle resolves transitive dependencies automatically. The version selection for transitive dependencies can be influenced by declaring dependency constraints.


1 Answers

Within app module's build.gradle I've imported Square's Moshi library as follows:

      dependencies {         compile 'com.squareup.moshi:moshi:+'     }  

Then I executed following command in terminal:

  ./gradlew app:dependencyInsight --configuration compile --dependency com.squareup.moshi:moshi  

Here's the output that I've received:

enter image description here

like image 50
azizbekian Avatar answered Oct 04 '22 01:10

azizbekian