Maven BOM DependencyManagement Explained for Spring Projects
Use dependencyManagement and a bill of materials in Maven to align library versions: import scope, the Spring Boot BOM, overriding and writing your own BOM.

dependencyManagement is Maven's tool for saying which version, without saying whether. A bill of materials, or BOM, is that tool packaged for reuse.
dependencyManagement in one project
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.17.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <!-- no version -->
</dependency>
</dependencies>The management section does not add the dependency. It sets the version, the scope and the exclusions that apply wherever the artifact appears, including transitive occurrences. That last point is why it is the standard fix for dependency conflicts.
Importing a BOM
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>4.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <!-- version from the BOM -->
</dependency>
</dependencies>The import scope replaces that entry with the contents of the BOM's dependencyManagement. This is how you get Boot's versions without inheriting from spring-boot-starter-parent, useful when your organisation already has its own parent POM. Only one parent is allowed, but any number of BOMs can be imported. If two BOMs manage the same artifact, the first declared wins, so order matters.
Common BOMs
| BOM | Manages |
|---|---|
spring-boot-dependencies | Spring and the libraries Boot integrates |
jakarta.platform:jakarta.jakartaee-bom | Jakarta EE API versions |
io.quarkus.platform:quarkus-bom | Quarkus extensions and libraries |
org.junit:junit-bom | JUnit modules |
com.fasterxml.jackson:jackson-bom | All Jackson artifacts |
io.micronaut.platform:micronaut-platform | Micronaut modules |
A BOM is more than a list: the versions in it are known to work together, which is the real value.
Override one version
Spring Boot's BOM defines version properties. With the parent, set the property in your POM:
<properties>
<jackson-bom.version>2.18.2</jackson-bom.version>
</properties>This changes the version everywhere the BOM uses it. With a plain import, override by declaring the artifact in your own dependencyManagement before the import, since the first declaration wins:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.18.2</version>
</dependency>
<dependency> ... spring-boot-dependencies import ... </dependency>
</dependencies>
</dependencyManagement>Override only for a security fix or a known bug, and record why.
Write your own
<project>
<groupId>dev.javahacks</groupId>
<artifactId>shop-bom</artifactId>
<version>1.4.0</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency><groupId>dev.javahacks</groupId><artifactId>shop-core</artifactId><version>${project.version}</version></dependency>
<dependency><groupId>dev.javahacks</groupId><artifactId>shop-client</artifactId><version>${project.version}</version></dependency>
</dependencies>
</dependencyManagement>
</project>Services import shop-bom and declare modules without versions, so a library release is one number. It belongs in a multi-module layout, see multi-module projects, and the Boot side is in creating a project with Maven.
Check what is effective
mvn help:effective-pom | grep -A3 "commons-lang3"
mvn dependency:treeThe effective POM shows the merged management section, and the tree shows the result.
Order and conflicts between BOMs
When you import more than one BOM, Maven applies them in the order they appear, and the first one to manage a given artifact wins. That is the explanation for the occasional case where a dependency has a version you did not expect after adding a second BOM. List the BOM that you most want to win first, and verify the result with the effective POM. Importing a BOM never overrides a version that you declare directly in your own dependencyManagement, which sits above imports in priority, so a one-line override is always available.
Management is not the same as declaration
A managed version applies only to a dependency that is actually used. Putting an artifact into dependencyManagement adds nothing to the classpath. That is the source of a common confusion: a team adds a BOM, sees no change in the jar, and wonders whether it works. It works by supplying the version when a <dependency> omits it, and also by overriding the version of transitive dependencies of the same artifact. The second behavior is the useful one, since it forces a safe version of a library that a framework pulls in indirectly.
Checking convergence
A BOM aligns the artifacts it lists and says nothing about the rest. For the rest, use the Enforcer plugin with the dependencyConvergence rule, which fails the build when two paths in the tree bring different versions of the same artifact:
<rules><dependencyConvergence/></rules>It will be noisy on a large project at first. Add the exclusions or managed versions that settle each conflict once, and the build stays aligned from then on. Pair it with mvn dependency:tree -Dverbose when you need to see which dependency pulled the conflicting version.
Publishing your own BOM
A company with many internal libraries benefits from a BOM of its own: a pom packaging module with a dependencyManagement section that lists every library at its released version. Teams import it and stop choosing versions. Release it together with the libraries so it never lists a version that does not exist, and when you publish it, use the flatten plugin to resolve properties so consumers see concrete numbers. A BOM is a public contract, and removing an artifact from it is a breaking change.
A practical example with Spring Boot
Most projects meet a BOM through Spring Boot. You can inherit from spring-boot-starter-parent, which also configures plugins and resource filtering, or import spring-boot-dependencies into dependencyManagement when your organization already has its own parent POM. The import gives the same managed versions without the plugin configuration. A frequent need is overriding one library's version, such as a Jackson or Netty release with a security fix. With the Boot parent you set the documented property in <properties>, for example <jackson-bom.version>, and every artifact of that family moves together, which is safer than pinning one of them.
Review the managed list when you upgrade Boot, because the BOM is the real content of an upgrade. A change in the version of Hibernate or Flyway between two Boot releases is a change in your application, and the release notes list them.
Checking an override
After overriding, prove that it took effect. Run mvn dependency:tree -Dincludes=com.fasterxml.jackson.core and look at the version of each artifact in the family. If one shows the old version, a different path pins it, usually an explicit <version> somewhere in the project, and the fix is to delete that line and let the BOM decide.
Where BOMs fall short
A BOM manages versions and does not check that the combination works. Two libraries that each pass their own tests can still conflict at run time through a shared transitive dependency, and only an integration test of your own application finds that out. Keep a build that runs the full test suite whenever the BOM version changes, and read the release notes of the BOM for the libraries you rely on most.
Where this does not apply
Gradle uses platform(...) for the same job and can consume the same BOM: implementation platform("org.springframework.boot:spring-boot-dependencies:4.0.0"). A BOM does not choose dependencies for you, only versions. The reference is the Maven dependency mechanism guide, and Spring Boot's dependency versions list the managed artifacts.


