Hi everyone!
I was wondering what the current recommendations for managing JVM (Java) dependencies in multi-project builds are.
For context, we’re talking about a Gradle multi-project build for a Java 11 application with ~100 subprojects and 242 unique external dependencies (dependencies between subprojects not counted).
I’ve found multiple approaches but would like to discuss the advantages and disadvantages.
- Declare dependencies in a dedicated submodule with the
java-platform
plugin and include the platform in all subprojects. This is the approach I’m currently using - Declare dependencies in a map in a Gradle script and refer to them in each subproject
build.gradle
file.
Example: Kafka - Declare dependency versions in
gradle.properties
and include them in every subproject.api("org.apache.kafka:kafka-clients:${kafka_version}") implementation("org.slf4j:slf4j-api:${slf4j_version}") // ...
Which approach are you using What are the advantages or disadvantages you see?