This message was deleted.
# community-support
s
This message was deleted.
c
Version catalogs aren’t intended to manage those type of constraints. Use the referenced syntax in your
dependencies
block to add the constraint.
👆 1
if you are looking for a centralized place to do so, create a convention plugin to apply across projects.
u
Thanks for this quick suggestion. So I’m wondering if version catalogs actually are intended for centrally defining the dependencies for several subprojects. Should we use platform definition instead? And would that allow us to define the transitive version constraints at a single place?
c
The Gradle docs do a good job at laying out various use cases for version catalogs, including when to use a platform and how that works with a version catalog. https://docs.gradle.org/current/userguide/platforms.html#sub:platforms-vs-catalog
u
Thank you.
v
Having the coordinates and version in the version catalog is perfectly fine, you just then have to use it in a constraint. So yes, defining the versions centrally in a version catalog is fine, but as Chris said, the version catalog is just as the name suggests a catalog with coordinates and versions to pick from. But just having them in there does not yet have an effect without using them somewhere. Using them in a platform that you then use in the projects is perfectly fine. When the question is whether to use version catalog or platform, the answer is often to use both. 🙂
🙏 1