Dependency Version Catalogs and Platforms
Centralize and enforce dependency versions across a large multi-module build using version catalogs and Gradle platforms (BOMs) for consistency and governance.
Dependency Version Catalogs and Platforms is a free Groovy & Gradle: JVM Automation and Build Engineering lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Groovy & Gradle: JVM Automation and Build Engineering learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Version Drift Problem
In enterprise builds with dozens of modules, the same library can end up declared with different versions, causing subtle runtime conflicts. Centralizing versions prevents this drift.
What is a Version Catalog?
A version catalog is a single typesafe list of dependencies and versions, defined in gradle/libs.versions.toml and shared across all modules.
The TOML Format
The catalog has sections for versions, libraries, and plugins.
[versions]
guava = "33.0.0-jre"
[libraries]
guava = { module = "com.google.guava:guava", version.ref = "guava" }Using Catalog Entries
In a build script you reference the typesafe accessor, getting IDE completion and a compile error if the name is wrong.
dependencies {
implementation(libs.guava)
}Bundles
Group related libraries into a bundle so modules add them all at once.
[bundles]
networking = ["retrofit", "okhttp"]Plugin Versions in the Catalog
Catalogs can also pin plugin versions, keeping the whole toolchain consistent.
[plugins]
spring = { id = "org.springframework.boot", version = "3.2.0" }What is a Platform?
A platform (Maven BOM) constrains versions of transitive dependencies without adding them. It governs what version wins during resolution.
Applying a Platform
Import a BOM with the platform() notation; aligned dependencies inherit its managed versions.
dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.2.0"))
implementation("org.springframework:spring-web")
}Publishing Your Own Platform
Large orgs publish an internal platform module so every team aligns on approved versions automatically.
plugins { id("java-platform") }
dependencies {
constraints {
api("com.acme:logging:2.1.0")
}
}Catalog vs Platform
They complement each other:
- Catalog: what you type when declaring dependencies
- Platform: which transitive versions are allowed at resolution
Governance Benefits
Together they give central teams control: upgrade a library once, and every module follows, with reviewable changes in version control.
Quick Check
Test your understanding of catalogs and platforms.
Recap
You learned centralized version management:
- Catalog in
libs.versions.tomlgives typesafe accessors - Bundles group related libraries
- Platforms (BOMs) constrain transitive versions
- Together they enforce consistency across large builds
Frequently asked questions
Is the “Dependency Version Catalogs and Platforms” lesson free?
Yes — the full text of “Dependency Version Catalogs and Platforms” is free to read here on the web, and the Groovy & Gradle: JVM Automation and Build Engineering course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Groovy & Gradle: JVM Automation and Build Engineering course, upgrade to CoddyKit PRO.
What will I learn in “Dependency Version Catalogs and Platforms”?
Centralize and enforce dependency versions across a large multi-module build using version catalogs and Gradle platforms (BOMs) for consistency and governance. You practise Groovy & Gradle: JVM Automation and Build Engineering with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Groovy & Gradle: JVM Automation and Build Engineering?
No prior experience is required. Groovy & Gradle: JVM Automation and Build Engineering on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Dependency Version Catalogs and Platforms” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Groovy & Gradle: JVM Automation and Build Engineering lesson?
Yes. Every Groovy & Gradle: JVM Automation and Build Engineering lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Gradle Build Scans & Insights
- Security & Credential Management
- Convention Plugins & Build Logic
- Dependency Version Catalogs and Platforms