What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Create a separate Gradle platform project for your Android library family, declare each managed library version as a dependency constraint, and publish the platform with Maven Publish. Consumers then import the BOM with platform() and declare only the libraries they need. A BOM aligns versions; it does not contain or automatically add the libraries’ compiled code.
What an Android library BOM does
A Gradle BOM is a platform that publishes dependency-management metadata. Its constraints tell Gradle which versions to use for specified library coordinates when a consumer imports the platform. The BOM is separate from the Android library projects: those projects publish their AARs or other artifacts, while the platform publishes version-management information.
This division makes a BOM useful when several modules are released as a compatible family. Rather than asking consumers to select a version for every module, you maintain the coordinated versions in one published platform. Gradle describes the Java Platform plugin as the mechanism for defining and publishing these constraints.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesCreate the platform project
Use a dedicated project for the BOM. Apply Gradle’s java-platform plugin to define the platform, and maven-publish to publish it. Add constraints for the modules consumers may use, then create a Maven publication from the javaPlatform component.
#1 Best Overall
plugins {
`java-platform`
`maven-publish`
}
group = "com.example.android"
version = "1.2.0"
dependencies {
constraints {
api("com.example.android:core:1.2.0")
api("com.example.android:ui:1.2.0")
}
}
publishing {
publications {
create<MavenPublication>("bom") {
from(components["javaPlatform"])
}
}
}
This Kotlin DSL example illustrates the configuration pattern; it is not a verified, repository-specific build script. Configure the destination repository and any required credentials for your publishing environment. Gradle generates the BOM’s Maven POM dependency-management entries from the platform constraints. The platform project is metadata-only and cannot also apply the java or java-library plugin in that same project, according to the Java Platform plugin documentation.
Publish the BOM separately from Android libraries
Publish the Android library artifacts and the BOM as related but distinct publications. Your Android library projects publish their compiled artifacts; the platform publication supplies dependency-management metadata. The Android guide explains publishing Android libraries with Maven Publish, while Gradle documents Maven publishing and the platform component.
Rank #2
Before releasing a BOM, make sure every version named by its constraints is available in the repository where consumers will resolve dependencies. Gradle’s BOM mechanism does not dictate your repository, credential setup, or release automation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Choose a release-version policy
The platform itself has a version, and its constraints specify the versions of the libraries it manages. Teams can use the same version number for the BOM and every library, or adopt another coordinated release scheme. Gradle requires constraints, not a particular numbering policy; choose a scheme your team can maintain and ensure each BOM release points to published artifacts.
If related modules do not already have a published BOM, Gradle’s version alignment guidance recommends introducing a platform with constraints for those components. For alignment among projects in the same build, Gradle also documents project dependencies used as constraints.
How consumers use the BOM
Consumers specify the BOM version once, then add each desired library as a dependency without repeating its managed version:
dependencies {
implementation(platform("com.example.android:library-bom:1.2.0"))
implementation("com.example.android:core")
implementation("com.example.android:ui")
}
The BOM does not pull in every module listed in its constraints. It manages versions for dependencies the consumer actually declares. This is also how the Android Compose BOM is used: select a BOM version, then declare the Compose libraries the project needs.
Use platform() by default for libraries
Gradle offers platform() and enforcedPlatform() for importing a platform. The distinction matters especially when you publish a library for others to consume.
Best Value
| Import notation | Constraint behavior | Transitive effect | Typical choice |
|---|---|---|---|
platform() |
Uses the platform’s constraints, which remain subject to normal version conflict resolution. | Constraints can be exposed to downstream dependency resolution. | Flexible default for libraries whose consumers may need version-resolution flexibility. |
enforcedPlatform() |
Converts platform constraints to strict versions. | Strict constraints propagate transitively to consumers. | Use deliberately when an application needs to enforce the platform’s versions; avoid imposing it from a library intended for downstream consumption. |
Gradle’s platforms documentation cautions: “enforcedPlatform should generally only be used in applications, not in libraries or other components consumed by others.” A strict transitive choice made by a library can limit the version choices available to its consumers.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.BOMs and version catalogs serve different roles
A BOM and a Gradle version catalog both centralize version information, but they operate in different dependency-management contexts. A BOM is a published platform whose constraints participate in dependency resolution for consumers. A version catalog organizes dependency coordinates and versions for use in a Gradle build. They are not interchangeable: choose the BOM when you need to publish shared version constraints for a library family, and use a catalog for build-level dependency declarations.
Check the Gradle syntax against your build
Gradle’s Java Platform plugin documentation identified itself as version 9.8.0 in the documentation consulted for this guidance. Gradle and Android tooling change over time, so verify the DSL and publication setup against the Gradle version used by your project. The Compose BOM page surfaced version 2026.08.00 as an example; that is not a recommendation for a new project’s version.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

