Scrivio Interview library
DesignIntermediate7 min read · updated 12 November 2026

Your organisation has 40 Maven services that each declare their own library versions. How would you introduce central dependency management without forcing every team into one parent POM?

I would publish an internal BOM, a pom-packaged artifact containing only dependencyManagement, that each service imports with type pom and scope import, so no service has to change its parent. Plugin management and build conventions stay in a separate, optional parent POM, so teams can adopt either one without the other. The BOM is versioned, Renovate or Dependabot raise upgrade pull requests in each service, the Maven Enforcer plugin with rules such as dependencyConvergence or requireUpperBoundDeps catches drift, and overriding a version locally is documented and needs a stated reason.

Background to this question

When 40 services each choose their own library versions, the organisation pays for it repeatedly: every security fix is 40 separate investigations, shared client libraries break in some services and not others, and nobody can say which Jackson or Netty version runs in production. Central version management solves that, but forcing everyone into one parent POM is a heavy-handed change, because many services already have a parent, such as spring-boot-starter-parent. In this answer, we will see why a BOM fits this situation, build one, separate it from the parent POM, automate upgrades, catch drift with the Enforcer plugin, and define how teams override versions.

1Why a BOM Instead of One Parent POM

Maven allows only one parent per module. A service that already inherits from spring-boot-starter-parent, or from a team's own parent, cannot also inherit from a corporate parent without rewiring its build. A mandatory single parent also bundles many decisions together: versions, plugin configuration, compiler settings, and anything else someone adds over time.

A BOM, bill of materials, avoids both problems. It is an ordinary POM with packaging pom whose main content is a dependencyManagement section. Importing it with scope import copies those managed versions into the service, and a project can import any number of BOMs. So a service keeps its current parent and gains the company's versions with a few lines.

2Building the Internal BOM

The BOM should build on existing BOMs rather than repinning everything by hand. For Spring services, it imports spring-boot-dependencies, then manages the company's own libraries and the few third-party libraries the platform has chosen beyond Boot's set.

XML
<!-- com.example.platform:platform-bom:2026.11.0 -->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>2026.11.0</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency> <!-- our own libraries, listed first -->
<groupId>com.example.platform</groupId>
<artifactId>audit-client</artifactId>
<version>3.4.1</version>
</dependency>
<dependency> <!-- Spring Boot's tested set -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.5.0</version> <!-- example version -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
<!-- a service's pom.xml: parent unchanged -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.example.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>2026.11.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

The service imports the BOM in its own dependencyManagement and drops the version elements from its dependencies. Notice the order inside the BOM: entries declared directly in a POM's dependencyManagement win over imported ones, and among imports the first declared wins, so the order is a deliberate decision, not an accident.

3Keeping Versions and Build Conventions Apart

Versions and build conventions change for different reasons and at different speeds. Library versions change every few weeks because of security fixes and upgrades. Build conventions, such as compiler settings, Surefire configuration, coverage rules and code formatting, change rarely and affect how every build behaves.

So I would ship two artifacts. The BOM holds versions only. A corporate parent POM, optional, holds pluginManagement and build conventions, and itself imports the BOM. A team that can use the corporate parent gets both; a team that must keep spring-boot-starter-parent imports only the BOM. Neither group is forced into the other's choice, and the adoption of each can be measured separately.

Step throughTwo artifacts, adopted independently
  1. Service POMkeeps its own parent if it needs to
  2. Optional corporate parentpluginManagement, compiler, test and quality conventions
  3. Internal platform BOMversions of company and selected third-party libraries
  4. Imported upstream BOMsspring-boot-dependencies, other vendor BOMs

4 layers, from the top down. Step through them one at a time.

A service can import the BOM without the parent; the parent imports the BOM itself.

4Automating Upgrades

A BOM only helps if services actually move to new versions. The BOM itself is released with a version, for example a calendar version like 2026.11.0, and release notes that list every change. Renovate or Dependabot, bots that open pull requests to update dependencies, watch each service repository and propose the bump to the new BOM version. The service's own CI runs its tests on the pull request, so the team reviews a green or red result, not a research task.

For a security fix, the platform team releases a patch BOM, such as 2026.11.1, and the bots open pull requests in all 40 services within hours. We can track which services are on which BOM version from the bots' dashboards or from a small report built from the repositories, which gives the organisation an answer to the question of who still runs the vulnerable version.

5Catching Drift With the Enforcer Plugin

Even with a BOM, versions can drift: a service pins its own version, or a library pulls in a transitive version the BOM does not manage. The Maven Enforcer plugin runs rules during the build and fails it when they are broken. The dependencyConvergence rule fails if two paths in the dependency tree bring different versions of the same artifact. The requireUpperBoundDeps rule fails if the resolved version of a dependency is lower than a version some other dependency asked for, which catches silent downgrades.

XML
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-versions</id>
<goals><goal>enforce</goal></goals>
<configuration>
<rules>
<requireUpperBoundDeps/> <!-- no silent downgrades -->
<dependencyConvergence/> <!-- one version per artifact in the tree -->
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- Failed: Require upper bound dependencies ... netty-handler 4.1.100 < 4.1.115 -->

dependencyConvergence is strict and can fail on harmless differences in a large tree, so I would start with requireUpperBoundDeps, add convergence once the BOM covers the common conflicts, and ship the configuration in the corporate parent for teams that use it.

6Overriding a Version, With a Reason

Sometimes a team must deviate: a library has a bug in the BOM's version, or the team needs a feature from a newer release before the platform has tested it. Forbidding overrides would just push teams to fork the BOM. Instead we document how to do it, by declaring the artifact with the desired version directly in the service's dependencyManagement, above the BOM import, and require a comment with the reason and an issue link. A small check in CI can list all overrides across services, so the platform team sees where the BOM is not meeting needs and can fix it in the next release.

7Follow-up questions

Why not let each team keep a properties block with versions instead?

Because properties are local to each POM and do not apply to transitive dependencies unless they feed dependencyManagement entries. A shared BOM is one artifact, versioned and released, that the bots can upgrade everywhere at once, and its managed versions also control transitive dependencies.

How do you roll out the BOM to 40 services in the first place?

Start with two or three willing teams, compare their resolved dependency trees before and after with mvn dependency:tree, and fix differences in the BOM. Then let the bots open adoption pull requests everywhere, with a short guide, and support teams through the first conflicts.

Should the BOM include every library any service uses?

No. It should manage what the platform supports and tests together. Libraries only one team uses stay in that team's POM, so a change to them does not need a BOM release and cannot affect other services.

8Conclusion

In this answer, we introduced central dependency management through an internal BOM that only contains dependencyManagement and is imported with scope import, so services keep their current parents. Build conventions live in a separate, optional parent POM. The BOM builds on spring-boot-dependencies, is versioned with release notes, and is adopted through Renovate or Dependabot pull requests; the Enforcer rules requireUpperBoundDeps and dependencyConvergence catch drift, and local overrides are documented, visible and justified.

What to say in the interviewAbout 80 seconds aloud

Open with

Since Maven only allows one parent, and many services already use spring-boot-starter-parent, I would not force a single parent. I would publish an internal BOM: a pom-packaged artifact that only has a dependencyManagement section, built on top of spring-boot-dependencies plus our own libraries and the few third-party libraries the platform supports.

Then, if they want more

Services import it with type pom and scope import, drop versions from their dependencies, and keep their existing parent. Plugin management and build conventions go into a separate, optional corporate parent that itself imports the BOM, so teams can adopt the versions without the build rules or both.

The BOM has proper versions and release notes, and Renovate or Dependabot open the upgrade pull requests in every service, where the service's CI shows whether it works; for a security fix we release a patch BOM and the bots roll it out within hours.

To catch drift, I would add the Maven Enforcer plugin, starting with requireUpperBoundDeps to stop silent downgrades and later dependencyConvergence. Finally I would document how to override a version locally, by declaring it in the service's dependencyManagement before the import, and require a comment with the reason, so overrides stay visible and tell us what the BOM is missing.

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 documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Maven guides
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 "Your organisation has 40 Maven services that each declare their own library versions....": https://scrivio-interview-library.netlify.app/java/maven/331504630f/