06 · Maven from first build to release / LESSON 22 OF 102
Dependency management, BOMs, and version conflicts
Dependency management chooses versions and defaults without automatically adding the dependency.
Before this lesson: Dependency scopes and transitive dependencies
Understand the topic
A BOM is a POM imported into dependencyManagement to coordinate compatible versions. A parent POM can also contribute plugins and properties. With Boot, prefer its managed dependency set before manually upgrading one framework component in isolation.
Maven mediation often selects the nearest dependency definition; equal-depth ordering can matter. Use dependency:tree and help:effective-pom to see the result. An exclusion may remove a conflict but can also remove something a library genuinely requires.
EXAMPLE · SHELL
Terminal
./mvnw dependency:tree -Dverbose
./mvnw help:effective-pom -Doutput=target/effective-pom.xmlWhat to expect
The dependency tree shows selected paths; the effective POM includes inherited and managed configuration.
YOUR TURN
Put it into practice
- 01Find the resolved Hibernate and JDBC driver versions.
- 02Trace which parent or BOM manages each and compare the declared POM with the effective POM.
- 03Verify: You can explain the winning version without guessing from the first declaration you see.
Pass a quiz or complete a lab to check today’s streak. Each lesson counts once per day, including when you review it later.
UNDER THE HOOD
Build the mental model
Dependency management chooses versions and defaults without automatically adding the dependency.
- 01A BOM is a POM imported into dependencyManagement to coordinate compatible versions. A parent POM can also contribute plugins and properties. With Boot, prefer its managed dependency set before manually upgrading one framework component in isolation.
- 02Maven mediation often selects the nearest dependency definition; equal-depth ordering can matter. Use dependency:tree and help:effective-pom to see the result. An exclusion may remove a conflict but can also remove something a library genuinely requires.
- 03Trace the example: The dependency tree shows selected paths; the effective POM includes inherited and managed configuration.
A mistake worth avoiding
A framework method is missing at runtime after a manual version override.
DEBUGGING ROOM
Something broke. Where do you look?
A framework method is missing at runtime after a manual version override.
Before revealing the diagnosis, write down your first investigation step.
CHECK YOUR UNDERSTANDING
Does dependencyManagement alone add a JAR to the classpath?
BUILD IT YOURSELF
Find the resolved Hibernate and JDBC driver versions.
- 1.Find the resolved Hibernate and JDBC driver versions.
- 2.Trace which parent or BOM manages each and compare the declared POM with the effective POM.
- 3.Reproduce this failure, then repair it: A framework method is missing at runtime after a manual version override.
Acceptance checklist
Lab completion is your self-report. Knowledge checks do not certify project quality.
RETRIEVE IT FROM MEMORY
Does dependencyManagement alone add a JAR to the classpath?
Revisit this lesson in three days after a successful check or lab.
Ready for the next step?
You can explain the winning version without guessing from the first declaration you see.
Reading is separate from passing a knowledge check or completing a lab.