gradlebuild.gradle

Gradle: specify appropriate repo for dependency


I have several repos and a lot of dependencies. It looks like this in build.gradle:

repositories {
    maven {url "A"}
    maven {url "B"}
}


dependencies {
    compile 'libA'
    compile 'libB'
    compile 'libC'
}

Is there is a way to specify that I will download libA from one repo (A) and libB and libC from another repo (B)?


Solution

  • There is no way to associate a dependency with a repository. The repositories will always be searched in their declared order.