$ ./gradlew -v
------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------
I have the following build.gradle
file for Project1
dependencies {
implementation "com.company.common:common-dep:2.0.0"
implementation "com.company.other:my-other-project:2.0.0"
}
I expect it to download common-dep:2.0.0
artifact.
However, here’s the build.gradle
for my-other-project
dependencies {
implementation "com.company.common:common-dep:1.0.0"
}
As you can see, it’s dependent on common-dep:1.0.0
, NOT common-dep:2.0.0
Now when I run depnency on the first project I get
./gradlew dependencies
+ com.company.common-dep:2.0.0 -> 1.0.0
That is, it uses the the lower version of the artifact, the one that it’s other dependency needs. I’m guessing this is the expected (and correct) behavior?