Maven build multiple projects without inheriting 2016-12-25 22:48

If you build root maven project the children project will be built automatically. In this page I will show you how to build multiple maven projects without inheriting. Let's say you have multiple maven projects like following.

│  ├─src
│  ├─target
│  └─pom.xml
│  ├─src
│  ├─target
│  └─pom.xml

Create another maven project let's say "build-all". The pom of this project is like following.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
    <packaging>pom</packaging><!--change the type of packageing to pom -->
        <module>../apache-common-lang3</module><!--relative path to the project you want build -->

Change the packaging to pom and add modules node. The content of child module node is the relative path to the project you want build. When you build build-all project with maven commend mvn clean install it will help you build both apache-common-lang3 and apache-common-io.