The information about which repository a dependency came from is not available, at least not in a way I’ve been able to find. I asked a similar question a while back, but in my case I was looking for the URL. I’m afraid you’re probably out of luck, without looking at modifying Gradle’s source
However, depending how bad you want/need this, you could create subprojects, each with one of the repositories, then add the dependencies to a configuration in those projects and enumerate Configuration#getIncoming()#getResolutionResult()#getAllDependencies()
looking for instances of ResolvedDependencyResult
.
repositories {
jcenter()
}
configurations {
xyz
}
dependencies {
xyz ...
}
task showDeps {
doLast {
println "Resolvable deps in jcenter():"
println configurations.xyz.incoming.resolutionResult.allDependencies.findAll { dep ->
dep instanceof ResolvedDependencyResult
}.join( '\n ')
}
}