Book Image

Mastering Apache Maven 3

Book Image

Mastering Apache Maven 3

Overview of this book

Table of Contents (16 chapters)
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Parent POM file


When we deal with hundreds of Maven modules, we need to structure the project to avoid any redundancies or any 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 branch, which is 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 the complete source, with all components. The pom.xml file at the root acts as a module-aggregating POM. It defines all Maven modules that need to be built under the <modules> element. Each module element defines the relative path (from the root POM file) 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 relationships with other Maven...