When we deal with hundreds of Maven modules, we need to structure the project to avoid any redundancies or duplicate configurations. If not, it will lead to a huge maintenance nightmare. Let's have a look at some popular open source projects.
The WSO2 Carbon Turing project, available at https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/, has more than 1000 Maven modules. Anyone who downloads the source code from the root should be able to build it with all the components. The pom.xml
file at the root acts as a module aggregating POM. It defines all the Maven modules that need to be built under the <modules>
element. Each module element defines the relative path (from the root POM) to the corresponding Maven module. There needs to be another POM file under the defined relative path. The root POM in the WSO2 Carbon Turing project only acts as an aggregator module. It does not build any parent-child relationship with other Maven modules. The following code...