forcedModules not working as expected unless transitive=false

We have a build that is failing with:

  • What went wrong:
    Could not determine the dependencies of task ‘:MyProject:distTar’.

Could not resolve all task dependencies for configuration ‘:MyProject:runtime’.
A conflict was found between the following modules:
- org.apache.avro:avro:1.7.7
- org.apache.avro:avro:1.8.1
Run with:
–scan or
:MyProject:dependencyInsight --configuration runtime --dependency org.apache.avro:avro
to get more insight on how to solve the conflict.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

We have the following:

configurations {
    all{conf -> 
        resultionStrategy {
            failOnVersionConflict()
            forcedModules=forcedLibraries // where this is some collection
}

In the forcedLibraries definition we set to force to use org.apache.avro:avro:1.7.7. Even with this the build still fails. Its only when i add the lines below does the build work:

configurations {
    runtime.transitive = false
    runtimeClasspath.transitive = false
    testRuntime.transitive = false
    testRuntimeClasspath.transitive = false  
    all{conf -> 
        resultionStrategy {
            failOnVersionConflict()
            forcedModules=forcedLibraries // where this is some collection
}

So it looks like the forcedModules setting only works when you disable the transitive dependency resolution. Any ideas why this is the case?

Please ignore. This was because a sub project was resetting the forcedLibraries value