0Pricing
Kotlin Academy · Lesson

Version Catalogs

Manage dependency versions.

Version Catalogs is a free Kotlin Academy 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 Kotlin Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Problem with Scattered Versions

In multi-module projects, dependency versions get duplicated across many build files. Updating one library means editing many places — error-prone and inconsistent.

What is a Version Catalog?

A version catalog centralizes dependency coordinates and versions in one place. Gradle generates a type-safe accessor you reference from any module.

The libs.versions.toml File

The default catalog lives at gradle/libs.versions.toml. It has sections for versions, libraries, plugins, and bundles.

[versions]
kotlin = "2.0.0"
coroutines = "1.8.1"

Declaring Libraries

The [libraries] section maps an alias to coordinates, referencing a version by name.

[libraries]
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
guava = { module = "com.google.guava:guava", version = "33.2.1-jre" }

Using a Library in build.gradle.kts

Reference catalog entries via the generated libs accessor. Dashes become dots.

dependencies {
    implementation(libs.coroutines.core)
    implementation(libs.guava)
}

Declaring Plugins

The [plugins] section centralizes plugin ids and versions.

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

Applying Catalog Plugins

Reference catalog plugins in the plugins { } block with the alias function.

plugins {
    alias(libs.plugins.kotlin.jvm)
    alias(libs.plugins.serialization)
}

Bundles

A bundle groups related libraries so you add them with a single accessor.

[bundles]
testing = ["junit", "mockk"]

// build.gradle.kts:
// testImplementation(libs.bundles.testing)

Type Safety and Autocomplete

Because libs is generated code, the IDE autocompletes entries and the build fails fast if you reference a missing alias — far safer than raw strings.

Naming Rules

Aliases use dashes or dots as separators, which map to nested accessors. coroutines-core becomes libs.coroutines.core. Avoid underscores.

Sharing Across Modules

The single TOML file is visible to every module automatically. Update a version once and all modules pick it up — the core benefit of catalogs.

Quick Check

What is the main advantage of a version catalog in a multi-module project?

Recap

Version catalogs tame dependency management:

  • Declare versions, libraries, plugins, bundles in gradle/libs.versions.toml
  • Reference via the type-safe libs accessor and alias(...)
  • One edit updates every module

That completes the Gradle course.

Frequently asked questions

Is the “Version Catalogs” lesson free?

Yes — the full text of “Version Catalogs” is free to read here on the web, and the Kotlin Academy 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 Kotlin Academy course, upgrade to CoddyKit PRO.

What will I learn in “Version Catalogs”?

Manage dependency versions. You practise Kotlin Academy 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 Kotlin Academy?

No prior experience is required. Kotlin Academy 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 “Version Catalogs” 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 Kotlin Academy lesson?

Yes. Every Kotlin Academy 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

  1. Gradle Kotlin DSL
  2. Dependencies and Plugins
  3. Custom Tasks
  4. Version Catalogs
← Back to Kotlin Academy