Apache Maven POM - Project Object Model POM Aggregation


Example

The modules of a multi-module project are aggregated from a hierarchical structure.

The root pom packing should look like:

<packaging>pom</packaging>

The following will be the directory structure of the project:

 |-- sample-app
  \   `-- pom.xml
   |-- sample-module-1
   |   `-- pom.xml
   |-- sample-module-2
   |   `-- pom.xml

Root POM:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sample</groupId>
  <artifactId>sample-app</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
 
  <modules>
    <module>sample-module-1</module>
    <module>sample-module-2</module>
  </modules>
  <dependencyManagement>
    ...
  </dependencyManagement>
</project>