I’ve been trying to troubleshoot something that seems odd to me. I have a mult-module build and each java project has the following:
configurations {
all {
resolutionStrategy {
// add a dependency resolve rule
eachDependency { DependencyResolveDetails details ->
if (proj.version.equals(details.requested.version)) {
println "yo: ${details.requested}"
}
}
}
}
The version of my project is 8.11.0-SNAPSHOT and my group is “mygroup”. The above just output’s a line indicating what dependencies hit my custom resolutionHandler.
One of my projects in my multi-module builds depends on two other libraries from the build, and the dependencies look like this:
dependencies {
...
compile project(':gp-jaxb-types')
compile project(":admin-client")
}
When I run my build, I see the following output:
...
:admin-client:build
...
:gp-jaxb-types:build
:services-lib:compileJava
yo: mygroup:gp-jaxb-types:8.11.0-SNAPSHOT
yo: mygroup:admin-client:8.11.0-SNAPSHOT
I’m surprised to see that my internal project dependencies are being passed to my registered resolutionStrategy handler. I thought that was intended for external dependencies only.
As my build/project is rather later and involved, I made a quick attempt to put together a sample project to reproduce this, but I couldn’t reproduce the behavior which is curious.
Should project dependencies be passed to my handler? It doesn’t seem to make sense to me. If so, is there a good recommended way to ignore them?
Thanks.
Doug