https://kotlinlang.org logo
#gradle
Title
# gradle
p

Pablichjenkov

01/23/2023, 5:38 PM
What is the best way or a good way to handle dependency versioning across multiple projects. Each project has its independent repo and exposes an aar, they are not modules in a single project. I am thinking of moving the common dependencies to a common project and expose them as api. The problem is that now, all projects need to depend on this common library, which is not necessarily what the business requires. Any recommendation?
Perhaps making an internal gradle convention plugin that has a file with the versions and apply them to each individual project🤔
w

wasyl

01/23/2023, 6:14 PM
You may want to look into publishing a bom via java platform: https://docs.gradle.org/current/userguide/java_platform_plugin.html That way you can share the versions but let each project decide which dependencies it pulls
p

Pablichjenkov

01/23/2023, 8:03 PM
Thanks for answering guys, they both sounds good. Any advantage/disadvantage of using java-platform plugin versus version-catalog.
Never mind, I found the answer in gradle official docs.
6 Views