There's project with different modules and dependencies and all of them are needed to be mvn clean installed one by one in a particular sequence.And they have different parents and that can't be changed. Now how can I automate this process with maven reactor.So just by performing "mvn clean install" just once will perform the same operation on all the modules in the given sequence .

2

There are 2 best solutions below

2
On

Maybe you can Work with Multiple Modules https://maven.apache.org/guides/mini/guide-multiple-modules.html

3
On

You can create a new parent of all other parents, this parent will be projects aggregator for all the other modules (the other parents), in that new parent you can order the modules as you want

<?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>build-all</groupId>
    <artifactId>build-all</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>../proj1/pom.xml </module>
        <module>../proj2/pom.xml </module>
        .
        .

    </modules>

</project>