I have a multi-project build where I have to exclude a transitive dependency and replace it by a dependency of the same module but a different version. I tried using something like in the example in 51.4.7. Excluding transitive dependencies and did this:
dependencies {
compile project(‘:baseproject’) {
exclude group: ‘com.miglayout’
}
compile ‘com.miglayout:miglayout-javafx:4.2’
}
But I get the following error:
A problem occurred evaluating project ‘:myproject’.
Could not find method exclude() for arguments [{group=com.miglayout}] on project ‘:baseproject’.
The example in the official docs is this:
dependencies {
compile(“org.gradle.test.excludes:api:1.0”) {
exclude module: ‘shared’
}
}
And apart from it not being a project dependency, I don’t see what is different from my code.
Thanks,
Robert