Scrivio Interview library
ConceptFoundations7 min read · updated 12 November 2026

What is a Maven BOM, and how does Spring Boot's dependency management help avoid version conflicts in a service?

A Maven BOM (bill of materials) is a POM whose dependencyManagement section lists versions for a family of libraries, so a project that imports it can declare those libraries without versions. Spring Boot ships one, spring-boot-dependencies, with versions of hundreds of libraries that the Spring team has tested together, so our service gets a consistent, known-good set instead of whatever versions happen to arrive transitively.

Why this question is asked

Version conflicts are one of the most common reasons a Spring Boot service fails at startup with NoSuchMethodError or ClassNotFoundException, or behaves strangely only in production. Interviewers ask about BOMs because the answer shows whether we understand how Maven picks a version when two libraries want different ones, and whether we know how to override a version safely when we need a fix. In this answer, we will recap what dependencyManagement does, see how Spring Boot's BOM is wired in through the parent or an import, look at what goes wrong when we override a managed version, and finish with the commands that tell us which version actually won.

1A Quick Recap of dependencyManagement

In a Maven POM, the dependencies section says which libraries our project uses. The dependencyManagement section is different: it does not add anything to the classpath. It only says 'if this library appears anywhere in the build, directly or transitively, use this version'. It is a table of agreed versions.

A BOM is simply a POM, with packaging pom, whose only real content is such a table. Its name comes from manufacturing, where a bill of materials lists every part and its exact specification. When we import a BOM, its table becomes part of our own dependencyManagement, and Maven applies it to every dependency in the build, including the ones pulled in by other libraries.

This matters because of how Maven chooses versions without a BOM. If our service depends on library A, which wants jackson-databind 2.17, and library B, which wants 2.19, Maven uses the rule called nearest wins: the version closest to our project in the dependency tree is chosen, and on a tie the one declared first. That choice has nothing to do with which version is newer or which one the libraries were tested with, so the result can change just because someone reordered two dependencies.

2How Spring Boot Uses Its BOM

Spring Boot's BOM is the artifact org.springframework.boot:spring-boot-dependencies. For each Boot release, it pins versions of Spring Framework, Hibernate, Jackson, Micrometer, Tomcat, the JDBC drivers and many more, and the Spring team runs its tests against exactly that combination. There are two ways to bring it in.

XML
<!-- Option 1: inherit from the Boot parent, which imports the BOM for us -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.7</version> <!-- check the current 3.5.x or 4.0.x patch -->
</parent>
<!-- Option 2: keep our own parent and import the BOM -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.5.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Either way, managed libraries need no version -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <!-- version comes from the BOM -->
</dependency>
Without and with the Boot BOM
SituationWithout a BOMWith the Boot BOM
Two libraries want different Jackson versionsnearest in the tree wins, by accidentthe BOM version wins everywhere
Adding a new starterwe must pick a version and hopeno version, the tested one is used
Upgrading Spring Bootedit many version numberschange one parent or BOM version
Knowing what was tested togetherunknownthe Boot release notes list it
The BOM turns version choice from an accident of tree order into a single decision.

Notice that the PostgreSQL driver has no version at all. Maven looks it up in the imported table. The parent does one more thing for us: it also configures plugins and, importantly, exposes every managed version as a Maven property, such as postgresql.version. With an import, we get the version table but not the properties trick, which matters in the next section.

In Gradle the same idea works through a platform: implementation(platform("org.springframework.boot:spring-boot-dependencies:3.5.7")), or through the Spring Boot plugin with the dependency management plugin. The effect is the same: one place decides the versions.

3Overriding a Managed Version, Deliberately

Sometimes we need a version the BOM does not have yet, usually a patch that fixes a security problem. With the Boot parent, the cleanest way is to set the property that the BOM uses.

XML
<properties>
<!-- Boot 3.5.7 manages a 42.7.x driver; we pin a newer patch for a fix -->
<postgresql.version>42.7.8</postgresql.version>
</properties>
<!-- With an imported BOM, properties do not reach it. Declare the override
in dependencyManagement BEFORE the BOM import: the first entry wins. -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.8</version>
</dependency>
<!-- then the spring-boot-dependencies import -->
</dependencies>
</dependencyManagement>

The reason to be careful is that the override is now outside the combination the Spring team tested. A patch release of a JDBC driver is usually safe. A jump of a minor or major version, for example forcing a newer Hibernate or Jackson line under an older Boot, can break things that depend on it: Spring Data may call a method that moved, and the failure might appear only at runtime in a code path our tests did not cover.

So we override deliberately. We write down why, in a comment next to the property, we check the library's release notes for breaking changes, and we remove the override as soon as a Boot release ships that version. An override that stays forever quietly blocks every future upgrade.

4Seeing Which Version Actually Won

When a conflict is suspected, we do not guess. Both build tools can show the resolved tree and why each version was chosen.

Properties
# Maven: show where jackson-databind comes from and which version was picked
mvn dependency:tree -Dincludes=com.fasterxml.jackson.core:jackson-databind
# [INFO] \- org.springframework.boot:spring-boot-starter-web:jar:3.5.7:compile
# [INFO] \- ...:jackson-databind:jar:2.19.2:compile (example output)
# Add -Dverbose to also see the versions Maven omitted and why (check your plugin version)
# Gradle: explain the choice for one module
./gradlew dependencyInsight --dependency jackson-databind --configuration runtimeClasspath
# com.fasterxml.jackson.core:jackson-databind:2.19.2
# Selected by rule ... (from the platform)

Notice that the Gradle output names the reason for the selection. That is the key difference from plain Maven: Gradle by default picks the highest requested version, while Maven picks the nearest, so the same set of libraries can resolve differently in the two tools unless a BOM or platform decides. Running one of these commands is the first step whenever a NoSuchMethodError appears after adding a dependency.

5Follow-up questions

Does the BOM add all those libraries to my service?

No. A BOM only lives in dependencyManagement, which records versions. A library reaches the classpath only when some dependency, ours or a transitive one, actually asks for it. Importing spring-boot-dependencies with hundreds of entries adds nothing to the jar by itself.

Can I import more than one BOM?

Yes, and it is common to import the Spring Cloud or Testcontainers BOM next to Spring Boot's. When two BOMs manage the same library, the one declared first in dependencyManagement wins, so order them deliberately and check the result with dependency:tree.

What is the difference between spring-boot-starter-parent and spring-boot-dependencies?

spring-boot-dependencies is the BOM: a version table. spring-boot-starter-parent inherits from it and adds build defaults such as plugin configuration, resource filtering and the Java release level. Teams that already have a company parent usually import the BOM instead of using the Boot parent.

6Conclusion

In this answer, we saw that a BOM is a POM whose dependencyManagement section lists agreed versions, and that importing it removes the accident of Maven's nearest-wins rule. Spring Boot's spring-boot-dependencies BOM pins versions that are tested together, so we add starters and libraries without versions. We override a managed version only on purpose, through the property with the parent or an earlier dependencyManagement entry with an import, and we confirm the winner with mvn dependency:tree or Gradle's dependencyInsight.

What to say in the interviewAbout 70 seconds aloud

Open with

A BOM, or bill of materials, is a POM that only contains a dependencyManagement section listing versions for a family of libraries. It does not add anything to the classpath; it says which version to use if that library shows up, directly or transitively.

Then, if they want more

Spring Boot publishes spring-boot-dependencies, which pins versions of Spring Framework, Hibernate, Jackson, Micrometer, the drivers and so on, all tested together for that Boot release. I get it either by inheriting spring-boot-starter-parent or by importing the BOM with scope import, and then I declare dependencies without versions. That avoids Maven's nearest-wins rule deciding versions by tree order.

If I need a newer version, say a security patch of a driver, I override it with the property like postgresql.version when using the parent, or with an entry before the BOM import when importing it. I do that deliberately, because I'm leaving the tested combination, and I remove the override once Boot catches up.

When something looks like a conflict, for example a NoSuchMethodError, I run mvn dependency:tree with an includes filter or Gradle's dependencyInsight to see exactly which version won and why.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "What is a Maven BOM, and how does Spring Boot's dependency management help avoid version...": https://scrivio-interview-library.netlify.app/architecture/platform-and-governance/01557f24a6/