Let's go through them one by one.
- a project dependency on another module in the build
This means that if a module A has a dependency on a module B, then B must be built before A. This handles the case where, in the POM of A, you'd have:
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>B</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
- a plugin declaration where the plugin is another modules in the build
This means that if a module A uses a Maven plugin which is a module B, then B must be built before A. This handles the case where, in the POM of A, you'd have:
<build>
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>B</artifactId>
<version>${project.version}</version>
</plugin>
</plugins>
</build>
- a plugin dependency on another module in the build
This means that if a module A uses a Maven plugin that has a dependency on a module B, then B must be built before A. This handles the case where, in the POM of A, you'd have:
<build>
<plugins>
<plugin>
<groupId>some.plugin.groupId</groupId>
<artifactId>some.plugin.artifactId</artifactId>
<version>some.version</version>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>B</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Note that this rule is applied after the last one, so even if the plugin itself is also a module of the build, it will be built before, making sure it is safe to resolve the dependencies.
- a build extension declaration on another module in the build
This means that if a module A declares to use as extention a module B, then B must be built before A. This handles the case where, in the POM of A, you'd have:
<build>
<extensions>
<extension>
<groupId>${project.groupId}</groupId>
<artifactId>B</artifactId>
<version>${project.version}</version>
</extension>
</extensions>
</build>
- the order declared in the
<modules>
element (if no other rule applies)
When none of the previous rules were applied, the order is the order of the <modules>
, which would look like in the POM of the aggregator project:
<modules>
<module>A</module>
<module>B</module>
</modules>
A would be built before B if none of the previous rules applied.