Normally when testing a plugin with Spock
testCompile ('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude module : 'groovy-all'
}
is good enough to resolve conflicts.
However, when the plugin is also dependent on a another subproject in a multi-project build this is not good enough. Consider
compile project(":another")
testCompile ('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude module : 'groovy-all'
}
Let’s just say ‘another’ will accept a range of groovy versions from 2.0-2.5. This causes version conflicts. I’ve tried to do something like
configurations.all {
def gr = project.dependencies.localGroovy()
resolutionStrategy.force "${gr.group}:${gr.name}:${gr.version}"
}
to force it to the local Groovy version, but the problem persists.
Any idea how one can manage the version conflict in this case? (I don’t want to change the ‘another’ subproject).