Maven pom.xml Viewer · Tutorial
How to review the dependencies in a Maven pom.xml
6 min readbeginnerUpdated
Before a release, you want to be sure the build uses fixed, known versions. You will open the POM, find entries that make builds unpredictable and decide how to fix each.
What you need
- The pom.xml Viewer
- Your project’s pom.xml
Steps
Open the POM
Load the example service. Spring Boot starters show Version from parent/BOM: the parent
spring-boot-starter-parentmanages their versions, which is fine.Show only problems
Tick Only show entries worth checking. Three remain: a snapshot, a version range and an unknown property.
Fix the range
payment-clientuses[1.2,2.0), so each build may pick a different version. Pin the one you tested.<version>1.4.2</version>Define the missing property
${audit.version}isn’t defined in this POM. Add it to<properties>or check that the parent defines it.Release the snapshot
shared-contractsfollows${project.version}, which is a snapshot. Release it first, then depend on the release version.
Try it yourself
Opens the Maven pom.xml Viewer with this tutorial's sample loaded.
Common mistakes
- Overriding managed versions casually
- Adding a version to a Spring Boot starter overrides the tested set. Only do it to fix a specific issue.
- Ignoring test scope
- Test dependencies don’t ship, but flagged test dependencies still make builds unpredictable.
Next steps
Go back to the Maven pom.xml Viewer, or keep going with one of these: