Maven Project Aggregationfleeting
- External reference: https://www.baeldung.com/maven-multi-module
- External reference: https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#project-aggregation
By setting packaging to pom type, we’re declaring that project will serve as a parent or an aggregator – it won’t produce further artifacts.
Next, when running mvn package command in the parent project directory, Maven will build and test all three modules
Project Aggregation is similar to Project Inheritance. But instead of specifying the parent POM from the module, it specifies the modules from the parent POM. By doing so, the parent project now knows its modules, and if a Maven command is invoked against the parent project, that Maven command will then be executed to the parent’s modules as well.
To do Project Aggregation, you must do the following:
Change the parent POMs packaging to the value “pom”. Specify in the parent POM the directories of its modules (children POMs).
Notes linking here
- dependency management and versioning with a maven multi-module project
- difference between maven inheritance (parent) and maven aggregation (module)
- how to correctly structure a maven project
- maven dependency mechanism
- maven modules + building a single specific module
- maven multi-modules project, installing the parent and incremental building
- Maven – Guide to Working with Multiple Modules
- Project Object Model