# Dependency Management - Best Practices for Naming Gradle Version Catalog Entries

DevFeed: [Dependency Management - Best Practices for Naming Gradle Version Catalog Entries](<https://devfeed.tech/articles/dependency-management-best-practices-for-naming-gradle-version-catalog-entries-24598.md>)

Original publisher: [Read original article](<https://blog.gradle.org/best-practices-naming-version-catalog-entries>)

Author: Benedikt Ritter

Published: 2024-07-08T04:00:00Z

Content type: article

Language: en

Sources: [The Gradle Blog](<https://devfeed.tech/sources/the-gradle-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Dependency management](<https://devfeed.tech/topics/dependency-management.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [gradle](<https://devfeed.tech/tags/gradle.md>)

## AI overview

This article explains how Gradle version catalogs standardize dependency definitions and describes the Develocity team's conventions for naming catalog entries based on GAV coordinates. It also shows how catalog entries generate compile-safe dependency accessors.

## Source excerpt

Version catalogs are a fairly recent feature in Gradle Build Tool. They help manage dependencies by providing a standardized way of defining and accessing the catalog of dependencies used in a project--ensuring that all developers in a team are aligned on dependency names and definitions saves time and cognitive load for everyone. Like most Gradle features they are quite flexible, so users have to come up with their own conventions for how to use them. In this blog post, we're going to share some of the best-practices we employ in the Develocity team when it comes to managing dependencies using version catalogs. In particular, we're going to look at our convention for how to derive a version catalog entry name from the GAV (short for Group, Artifact ID, Version) coordinates of a particular dependency. Version catalogs Version catalogs are part of Gradle's dependency management features. They provide a convenient, standardized way to define a set of dependencies that are available to engineers in the project. Version catalogs can either be defined directly in Gradle's settings script, or using a separate TOML file. The default for a TOML catalog is to place it in gradle/libs.versions.toml. This will create a libs catalog to be used in the build. An example entry in TOML format can look like this: commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.14.0" } When Gradle finds a version catalog, it generates accessors that can be used in the build scripts to define dependencies in a compile-safe way. So instead of writing: implementation("org.apache.commons:commons-lang3:3.14.0") And repeating the GAV coordinate string in each of the build scripts where we need this dependency, we can now write: implementation(libs.commons.lang3) As we can see from this example there are some rules that Gradle applies while translating from the catalog entry commons-lang3 to the accessor libs.commons.lang3. Furthermore a question that we could be asking is why I ca