Guide to Working with Multiple Modules – Maven (original) (raw)

(If you're working with Maven 4, please refer to the Maven 4 edition of this guide)

As seen in the introduction to the POM, Maven supports project aggregation in addition to project inheritance. This section outlines how Maven processes projects with multiple modules, and how you can work with them more effectively.

The Reactor

The mechanism in Maven that handles multi-module projects is referred to as the reactor. This part of the Maven core does the following:

Reactor Sorting

Because modules within a multi-module build can depend on each other, it is important that the reactor sorts all the projects in a way that guarantees any project is built before it is required.

The following relationships are honoured when sorting projects:

Note that only "instantiated" references are used - dependencyManagement and pluginManagement elements do not cause a change to the reactor sort order.

Command Line Options

No special configuration is required to take advantage of the reactor, however it is possible to customize its behavior.

The following command line switches are available:

Refer to the Maven command line interface reference for more information on these switches.

More information