Scrivio Interview library
DebuggingIntermediate6 min read · updated 12 November 2026

A service uses spring-boot-starter-parent and also needs the company's corporate parent POM, but Maven allows only one parent. What are your options and their trade-offs?

We have two main options. The corporate parent can itself inherit from spring-boot-starter-parent, so services get both, but corporate releases are then tied to Spring Boot versions. Or the corporate parent stays the parent and imports spring-boot-dependencies as a BOM, which gives Boot's versions but loses the starter parent's plugin configuration, such as resource filtering and the repackage execution, which we must add ourselves. Reusable plugin configuration can also come from tiles-maven-plugin or, later, Maven 4 mixins; in every case we confirm the result with help:effective-pom and document one pattern.

Why this question is asked

Maven allows exactly one parent, and two good reasons to have one meet in almost every company: Spring Boot's starter parent, which brings tested versions and sensible build defaults, and the corporate parent, which brings the company's rules. Interviewers ask this because each solution has a cost that shows up later, often as a missing plugin execution that nobody notices until a jar will not start. In this answer, we will recap what each parent provides, then look at a parent chain, a BOM import, and reusable configuration pieces, and see how to verify and standardise the choice.

1What Each Parent Provides

spring-boot-starter-parent does two jobs. Through its own parent, spring-boot-dependencies, it manages the versions of hundreds of libraries tested with that Spring Boot release. And it configures the build: the java.version property and compiler release, UTF-8 encoding, filtering of application properties and YAML files with the @...@ placeholder style, the -parameters compiler flag, and pluginManagement for the Spring Boot Maven plugin, including its repackage execution, which turns the plain jar into an executable one.

The corporate parent typically adds the company's rules: Enforcer rules, release and deployment settings, the internal repository configuration for publishing, approved plugin versions, and perhaps code quality plugins. Both sets are useful, and Maven lets a POM have only one parent element.

2Option 1: The Corporate Parent Inherits From the Boot Parent

The simplest way to get both is a chain: the corporate parent names spring-boot-starter-parent as its own parent, and services name the corporate parent.

XML
<!-- acme-boot-parent 7.4.0 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.7</version>
</parent>
<groupId>com.acme</groupId>
<artifactId>acme-boot-parent</artifactId>
<version>7.4.0</version>
<packaging>pom</packaging>
<!-- Enforcer rules, release settings, company plugin versions -->
<!-- each service -->
<parent>
<groupId>com.acme</groupId>
<artifactId>acme-boot-parent</artifactId>
<version>7.4.0</version> <!-- implies Spring Boot 3.5.7 -->
</parent>

Services get everything from both parents, with no extra work. The trade-off is coupling: each corporate parent release is tied to one Spring Boot version, so a team that needs a corporate fix must also take the Spring Boot version that comes with it, and the platform team must release a new corporate parent for every Spring Boot release. Many companies accept this, because they want services to move with Spring Boot anyway, and they publish a parent version per Boot line, such as 7.x for Boot 3.5 and 8.x for Boot 4.0.

3Option 2: Corporate Parent Plus the Boot BOM

The other way is to keep the corporate parent independent and import Spring Boot's versions as a BOM. A BOM import, a dependency with type pom and scope import inside dependencyManagement, copies the managed versions of another POM without inheriting from it.

XML
<!-- service pom.xml -->
<parent>
<groupId>com.acme</groupId>
<artifactId>acme-parent</artifactId> <!-- no Spring Boot inside -->
<version>12.0.0</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.5.7</version>
<type>pom</type>
<scope>import</scope> <!-- versions only, not build configuration -->
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution><goals><goal>repackage</goal></goals></execution> <!-- must be added by hand -->
</executions>
</plugin>
</plugins>
</build>
The two main options compared
AspectCorporate parent inherits Boot parentCorporate parent plus Boot BOM
Spring Boot versionsYes, inheritedYes, imported
Boot build defaultsYes, inheritedNo, add them by hand
Choose Boot version separatelyNo, tied to the parent releaseYes
Releases neededOne corporate parent per Boot releaseCorporate parent changes less often

This decouples the two: the service chooses its Spring Boot version independently of the corporate parent. But there is a catch: a BOM import brings versions, never build configuration. The service loses everything the starter parent configured: the repackage execution, the resource filtering of application files, the -parameters flag, the encoding and Java release defaults. If we forget the repackage execution, the build succeeds and produces a plain jar, and java -jar fails with 'no main manifest attribute'. So the corporate parent, or the service, must add those settings back explicitly.

4Option 3: Reusable Configuration Pieces

What we really want is to combine several pieces of build configuration, which plain inheritance does not allow. The tiles-maven-plugin, an open source Maven extension, lets a POM pull in several 'tiles', small POM fragments with plugin configuration, that are merged as if they were extra parents. It works today, but it is an extra extension to understand and maintain.

Maven 4 plans to support mixins, a built-in way to compose configuration from several POMs, as part of its newer POM model. Their availability and exact form depend on the Maven 4 release, so check the current release notes before planning around them. Until then, a parent chain is still the most common approach.

5Verify, Then Document One Pattern

Whichever option we choose, the final configuration is the merge of several POMs, so we check it with mvn help:effective-pom. In particular, we look for the spring-boot-maven-plugin with its repackage execution, the compiler release, and resource filtering. A quick test that starts the built jar with java -jar in CI catches a missing repackage immediately.

Finally, the company should choose one pattern and document it, with an example POM in the service template. When some services use a chain, others a BOM import, and others a copy of both, every Spring Boot upgrade becomes three different projects and the next person debugging a build has to work out which pattern they are in.

Step throughChoosing the pattern
  1. Should services always move with Spring Boot?
    YesCorporate parent inherits the Boot parentNoCorporate parent plus Boot BOM
  2. Using the BOM option?
    YesAdd repackage, filtering and compiler defaults to the corporate parentNoNothing to add
  3. Check help:effective-pom and java -jar in CIconfirm the plugins really run
  4. Document the pattern in the templateone way for every service

4 steps in order. Play them, or step through them one at a time.

6Follow-up questions

Why not just copy the starter parent's plugin configuration into each service?

Because the copies freeze. Every Spring Boot release may change that configuration, and copied settings in dozens of services will drift apart. If we use the BOM option, the right place for the missing configuration is the corporate parent, so it is maintained once.

How do you see what you lose when switching from the starter parent to a BOM?

Generate the effective POM of a service before and after the change and compare them. The differences in the build section, plugins, executions and properties, are exactly what the starter parent was providing, and that list becomes the checklist of what to add back.

Can the corporate parent import the Boot BOM itself?

Yes, and that is a good refinement of the second option. The corporate parent imports spring-boot-dependencies in its own dependencyManagement and adds the Boot plugin configuration in pluginManagement. Services then get both from one parent, and the corporate parent controls which Spring Boot version is the default, while a service can still override the version property if needed.

7Conclusion

In this answer, we saw that a service needing both spring-boot-starter-parent and a corporate parent has two main options: a chain where the corporate parent inherits from the Boot parent, which ties corporate releases to Boot versions, or a corporate parent plus the spring-boot-dependencies BOM, which decouples them but loses the starter parent's build configuration, such as repackage and resource filtering. Tiles and future Maven 4 mixins offer composition, help:effective-pom confirms what applies, and documenting one pattern keeps services consistent.

What to say in the interviewAbout 90 seconds aloud

Open with

Since Maven allows one parent, I see two main options. The first is a chain: the corporate parent itself inherits from spring-boot-starter-parent, and services inherit the corporate parent.

Then, if they want more

Services then get Boot's managed versions, Boot's build defaults and the company rules with no extra work. The cost is that each corporate parent release is tied to one Spring Boot version, so the platform team releases a new parent per Boot release, and a team cannot take a corporate fix without the Boot version that comes with it.

The second option keeps the corporate parent as the parent and imports spring-boot-dependencies as a BOM, with type pom and scope import. That decouples the versions, but a BOM only brings versions, never build configuration.

So we lose the starter parent's setup: the repackage execution of the Boot Maven plugin, resource filtering of application files, the parameters flag and the Java release defaults. Forget repackage and you get a jar that java -jar refuses to run. Those settings need to be added back, ideally once in the corporate parent.

There are also composition tools like tiles-maven-plugin, and Maven 4 plans mixins, though I would check their availability first. Whatever we choose, I would verify it with help:effective-pom, add a CI check that starts the jar, and document one pattern in the service template.

About this answer

Last updated
12 November 2026
Versions it names
Spring Boot 3.5
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 "A service uses spring-boot-starter-parent and also needs the company's corporate parent...": https://scrivio-interview-library.netlify.app/java/maven/5f138a3f7c/