What is a Maven BOM and when would you use `dependencyManagement`?
AdvancedConceptBuild Tools and Artifact Repositories
Answer
A BOM (Bill of Materials) is a POM that only declares managed dependency versions. Importing it with scope import in dependencyManagement aligns versions for a whole family (Spring Boot, Jackson) so you do not specify them individually and avoid mismatches. dependencyManagement in a parent POM centralises versions across modules without forcing the dependency on each.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.4.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerWhat is the difference between `mvn package`, `install` and `deploy`?BeginnerHow do Maven dependency scopes and transitive dependencies work?IntermediateWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?Intermediate