I have a gradle project which is used as a library in other projects. The library project specifies a dependency:
compile('org.apache.kafka:kafka-clients') {
version {
strictly '2.6.1'
}
}
However, when building another project which uses this library, the version gets downgraded to '2.3.1'. I found out that it happens because the project also uses Spring Boot gradle plugin and Spring Boot depends on that version. How can I ensure that the version from my custom library is used? I know how to do it directly in the child project but the problem is that there are many projects that use the library and I would like to avoid repeating dependency version in each of them. Is there a way to do it in a single place (either a custom library or a custom gradle plugin)?
I already tried specifying dependency version with strictly
keyword and trying to put kafka.version
in gradle.properties
. However, it all works only if done directly in the child project but not if I do it in the library project.