Maven BOM (Bill of Materials)
Fast recall
Quick revision
Core answer
dependencyManagement with type pom and scope import—that supplies a coordinated set of dependency versions. It does not add those libraries by itself and cannot guarantee compatibility; consumers still declare the dependencies they use and rely on the BOM maintainer's tested recommendations.Understanding of advanced Maven dependency management patterns used heavily in Spring Boot and modern Java frameworks
Confusing BOM import (in dependencyManagement) with a regular dependency, thinking the BOM itself provides classes
Explain that spring-boot-starter-parent is actually a BOM, so most Spring Boot developers use one without realizing it
Interview-ready guide
Interview answer
A BOM, or Bill of Materials, is a special Maven POM file that contains a curated set of dependency versions that are known to work together.
It's not a library that provides classes—it's more like a version lookup table. " The most common example is Spring Boot. Spring Boot maintains a BOM called spring-boot-dependencies that lists tested versions for hundreds of libraries: Spring Framework, Jackson, Hibernate, Tomcat, and so on.
Instead of you manually figuring out that Spring six point oh point eleven works with Jackson two point fifteen point three, you just import the Spring Boot BOM. Here's how it works. xml, you have a dependencyManagement section—not the regular dependencies section.
Inside dependencyManagement, you add the BOM as a dependency with type pom and scope import. This tells Maven to pull in all the version definitions from that BOM. Then, down in your regular dependencies section, you add the libraries you actually want, but you leave out the version tags.
Maven looks up the version in the BOM you imported.
For example, you'd add spring-boot-starter-web without a version, and Maven uses whatever version the BOM says, which is three point two point oh in this case. The beauty is you don't have to worry about compatibility—Spring Boot already tested all those versions together. One common mistake is putting the BOM in the regular dependencies section instead of dependencyManagement.
That won't work because scope import only works in dependencyManagement. Another mistake is thinking the BOM adds dependencies to your project. It doesn't.
You still have to explicitly list each dependency you want—the BOM just manages the versions. Most Spring Boot developers actually use a BOM without realizing it. When you extend spring-boot-starter-parent in your POM, that parent is essentially a BOM plus some Maven plugin configuration.
Maven BOM (Bill of Materials)
Direct Answer
A Maven BOM is a POM—usually imported into dependencyManagement with type pom and scope import—that supplies a coordinated set of dependency versions. It does not add those libraries by itself and cannot guarantee compatibility; consumers still declare the dependencies they use and rely on the BOM maintainer's tested recommendations.
Code Example
<project>
<dependencyManagement>
<dependencies>
<!-- Import Spring Boot BOM: defines versions for 200+ libraries -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.2.0</version>
<type>pom</type> <!-- BOM is a special POM file -->
<scope>import</scope> <!-- import scope pulls in its version definitions -->
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- No version specified: Maven uses version from BOM -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- BOM says 3.2.0, so this resolves to 3.2.0 -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<!-- BOM says 2.15.3, guaranteed compatible with Spring Boot 3.2.0 -->
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<!-- BOM says 42.6.0, tested with this Spring Boot version -->
</dependency>
</dependencies>
</project>
Common Mistakes & Pitfalls
- Putting BOM in dependencies instead of dependencyManagement: Freshers see the BOM as a dependency and add it to the regular dependencies section. This fails because scope import only works in dependencyManagement. The BOM doesn't get applied, and Maven complains about missing versions. Always put BOM imports in dependencyManagement.
- Thinking the BOM adds dependencies: Freshers import a BOM and expect all those libraries to be on their classpath. BOMs don't add anything—they only define versions. You still need to explicitly add each dependency you want in the dependencies section, just without version tags.
- Not realizing spring-boot-starter-parent is a BOM: Most Spring Boot tutorials say "extend spring-boot-starter-parent" but don't explain it's actually a BOM plus some Maven plugin configuration. If you can't use parent POM inheritance (because you have your own corporate parent), you can import spring-boot-dependencies as a BOM instead—it provides the same version management without the parent relationship.
Check your understanding
Answer these without looking back at the article.
- How do you use the Spring Boot BOM without using spring-boot-starter-parent?
- What is the difference between <dependencies> and <dependencyManagement>?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.