The situation is, I have two Maven multimodule projects with the same structure:
Parent
- Module 1
- Module 2
When I build project 1, I see that parent is built first (order is parent->module1->module2). However for project 2, parent is built at last (order is module1->module2->parent). Why are the two projects have different build orders? Furthermore, how can I manually control the build order?
Update 1:
Both parent projects are simple POM projects without source code, so I can't explain the build order as per the dependency graph.
Update 2:
The parent POMs are the same except the GAV and child module names:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>parent-group-id</groupId>
<artifactId>parent-artifact-id</artifactId>
<version>parent-version</version>
<packaging>pom</packaging>
<name>parent-name</name>
<modules>
<module>module-1</module>
<module>module-2</module>
</modules>
</project>