I’ve got a project where my build.gradle looks something like the snippet below:
configurations.all {
resolutionStrategy {
// fail eagerly on version conflict (includes transitive dependencies)
failOnVersionConflict()
force('org.hamcrest:java-hamcrest:2.0.0.0')
}
}
dependencies {
modules {
module("org.hamcrest:hamcrest-library") {
replacedBy("org.hamcrest:java-hamcrest")
}
}
testCompile('com.lordofthejars:nosqlunit-elasticsearch:0.8.1')
testCompile('org.hamcrest:java-hamcrest:2.0.0.0')
}
When I try building I get the error below:
Could not resolve all dependencies for configuration ':testCompile'.
> A conflict was found between the following modules:
- org.hamcrest:java-hamcrest:2.0.0.0
Am I doing something wrong or is there an issue with module replacement and failOnVersionConflict()? This is with gradle 2.3. Any help would be appreciated.