# Version Catalog Standards
## Rule
All dependency versions MUST be declared in gradle/libs.versions.toml. No inline version strings in build.gradle.kts files.
## Format
```toml
# gradle/libs.versions.toml
[versions]
library-name = "1.2.3"
[libraries]
library-name = { module = "group:artifact", version.ref = "library-name" }
[bundles]
related-libs = ["lib-a", "lib-b"]
[plugins]
plugin-name = { id = "plugin.id", version.ref = "version" }
```
## Requirements
1. **All versions in catalog** — no version strings in build.gradle.kts
2. **Naming conventions** — use kebab-case for aliases, map to accessor names
3. **Version references** — use `version.ref` for shared versions
4. **Bundles** — group related dependencies that are always used together
5. **Plugin versions** — declare in [plugins] section, apply with `alias()`
## Examples
### Good
```kotlin
// build.gradle.kts
dependencies {
implementation(libs.spring.boot.starter.web)
implementation(libs.bundles.jackson)
testImplementation(libs.bundles.testing)
}
```
### Bad
```kotlin
// Inline version — forbidden
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web:3.3.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.17.0")
}
```
## Enforcement
Use a custom Gradle lint task or CI check that scans build.gradle.kts files for string-based dependency declarations with version numbers.