Scrivio Interview library
ConceptFoundations6 min read · updated 12 November 2026

Explain the difference between a parent POM (inheritance) and an aggregator POM (modules). What is inherited from a parent, and what is the super POM?

A parent POM is about inheritance: a child declares it in a parent element and inherits its properties, dependencyManagement, pluginManagement, plugin configuration, repositories and more. An aggregator POM is about building together: its modules list tells the reactor which modules to build in one run, but it gives them no configuration. One POM is often both, but they can be separate. The super POM is Maven's built-in parent of every POM, defining default directories and the Central repository, and mvn help:effective-pom shows the merged result.

Why this question is asked

Every multi-module Maven project uses both inheritance and aggregation, usually in the same top-level file, so many developers never separate the two ideas. Then they meet a corporate parent that lists no modules, or a module that does not get the configuration they expect, and the build stops making sense. Interviewers ask this to check that we understand what Maven actually does with these elements. In this answer, we will look at inheritance and aggregation separately, see what a child inherits, combine them in one POM and then split them, meet the super POM, and use the effective POM to see the final result.

1Inheritance: What a Parent POM Does

Inheritance works from the child's side. A child POM names its parent with groupId, artifactId and version, and Maven merges the parent's content into the child before building it. The parent must have packaging pom, because it is a configuration file, not a jar.

XML
<!-- orders/pom.xml -->
<parent>
<groupId>com.acme</groupId>
<artifactId>acme-parent</artifactId>
<version>12.0.0</version>
<!-- relativePath defaults to ../pom.xml; otherwise Maven looks in repositories -->
</parent>
<artifactId>orders</artifactId> <!-- groupId and version are inherited -->

Notice that the parent does not know about this child at all. Hundreds of projects can name the same parent, and the parent's author does not need to list them. Maven first looks for the parent at relativePath, by default the folder above, and if it is not there, it downloads the parent from a repository like any other artifact.

2What a Child Inherits

Most of the POM is inherited. The child gets the parent's groupId and version (if it does not set its own), properties, dependencies, dependencyManagement, the build section with plugin configuration and pluginManagement, repositories and pluginRepositories, profiles, reporting, and descriptive information such as the organisation, licences, developers and SCM. A few things are deliberately not inherited, such as artifactId and name, because they identify this project.

There is an important difference between two pairs. dependencies in the parent are added to every child, which is rarely what we want for a shared parent. dependencyManagement only sets versions, which a child uses if it declares the dependency. The same holds for plugins: a plugin in the build section runs in every child, while pluginManagement only configures a plugin for children that use it.

Inherited or not
ElementInherited?Effect in the child
groupId, versionYes, unless setDefault coordinates
propertiesYesValues available, child can override
dependenciesYesAdded to every child
dependencyManagementYesVersions used if the child declares the dependency
build plugins / pluginManagementYesPlugins run / configured only if used
repositories, profilesYesAvailable to the child
artifactId, nameNoEach project names itself
modulesNoAggregation belongs to this POM only

3Aggregation: What the Modules List Does

Aggregation works from the other side. A POM with packaging pom and a modules section lists directories, and when we run Maven on it, the reactor collects those modules, orders them by their dependencies and builds them all in one run. That is all aggregation does: it decides what is built together. It does not pass any configuration to the modules.

XML
<!-- shop/pom.xml as a pure aggregator -->
<groupId>com.acme</groupId>
<artifactId>shop-build</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<modules>
<module>orders</module>
<module>payments</module>
</modules>
<!-- orders and payments get nothing from this file unless they also name it as parent -->

4Both in One POM, or Separate

In a typical multi-module project, the top POM is both: it lists the modules, and each module names it as its parent. That is convenient because shared configuration and the list of modules live in one place, and that is why the two ideas get confused.

But they can be separate, and in larger companies they usually are for at least one level. A corporate parent such as acme-parent is released on its own and inherited by hundreds of projects that it does not aggregate. And a project's top-level aggregator might inherit from acme-parent itself, while some of its modules inherit from a different parent, such as a parent for batch jobs.

Step throughA common real setup
  1. Super POMbuilt into Maven: defaults for every project
  2. acme-parentcorporate parent, released separately, inherited
  3. shop (top POM)inherits acme-parent; aggregates orders and payments
  4. orders, paymentsinherit shop; built together by the reactor

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

Inheritance goes up the stack; aggregation only lives in the shop POM.

5The Super POM

Every POM has a parent, even if it does not declare one. If there is no parent element, Maven uses the super POM, which is built into Maven itself. It defines the defaults that make convention over configuration work: the source directories src/main/java and src/test/java, the resources directories, the output directory target, the final name of the artifact, and the Maven Central repository. That is why a POM with only coordinates can compile code and download dependencies.

6Seeing the Result With help:effective-pom

Because a POM's final content comes from merging the super POM, every parent in the chain and the active profiles, reading the file itself often does not tell us what Maven will do. The help plugin prints the merged result.

Shell
$ mvn help:effective-pom -pl orders
# <project>
# <groupId>com.acme</groupId> <!-- from shop -->
# <artifactId>orders</artifactId>
# <properties><java.version>21</java.version> <!-- from acme-parent -->
# ...
# <repositories><repository><id>central</id> <!-- from the super POM -->
$ mvn help:effective-pom -Dverbose
# each line is annotated with the POM it came from (recent help plugin versions)

This is the fastest way to debug inherited settings. When a plugin runs with a surprising configuration or a property has an unexpected value, the effective POM shows the actual value, and the verbose form shows where it came from.

7Follow-up questions

Can a module have a parent that is not the aggregator?

Yes. The parent is whatever the module names in its parent element, which can be a corporate parent from a repository or a sibling POM. The aggregator only decides that the module is built in the same reactor. This is common when a project's modules need different base configurations.

Why should a shared parent avoid a dependencies section?

Because every dependency listed there is added to every child, whether it uses it or not, which makes artifacts larger and causes conflicts. A shared parent should use dependencyManagement and pluginManagement, so children opt in by declaring what they use and get the version and configuration from the parent.

What does relativePath do?

It tells Maven where to look for the parent's POM on disk, by default ../pom.xml. If the file there is not the declared parent, Maven falls back to repositories. Setting an empty relativePath tells Maven to skip the disk lookup, which is common when a project uses a released corporate parent rather than a folder above it.

8Conclusion

In this answer, we saw that inheritance and aggregation are two separate mechanisms. A parent POM, named in a child's parent element, passes properties, dependencyManagement, plugin configuration and more down to the child. An aggregator POM's modules list only tells the reactor what to build together. They often share one file, but a corporate parent is the classic case where they are separate. The super POM is the built-in parent of every POM, and help:effective-pom shows the merged result.

What to say in the interviewAbout 90 seconds aloud

Open with

They are two separate features that often live in the same file. Inheritance is the parent element in a child POM. The child names its parent, Maven merges the parent's content into it, and the child inherits things like groupId and version, properties, dependencies, dependencyManagement, plugin configuration and pluginManagement, repositories and profiles.

Then, if they want more

Things that identify the project, like artifactId, are not inherited. The parent does not need to know its children, which is how one corporate parent can serve hundreds of projects. Aggregation is the modules list. A POM with packaging pom lists module directories, and when we build it, the reactor builds them all together in dependency order.

It does not give them any configuration. In a typical multi-module project, the top POM is both the aggregator and the parent of its modules, but they can be separate, for example a corporate parent that is released on its own and aggregates nothing, or a module whose parent is a different POM from the aggregator.

The super POM is Maven's built-in default parent for every POM. It defines the standard directories like src/main/java and target, and the Maven Central repository. When inherited settings confuse me, I run mvn help:effective-pom, which shows the fully merged POM, and with verbose it even shows which file each value came from.

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 "Explain the difference between a parent POM (inheritance) and an aggregator POM...": https://scrivio-interview-library.netlify.app/java/maven/4dd2b23845/