Defining a parent module
In most of the multi-module Maven projects, there are many things that are shared across multiple modules. Dependency versions, plugin versions, properties, and repositories are only some of them. It is a common (and a best) practice to create a separate module called parent
and define everything in common in its POM file. The packaging type of this POM file is pom
. The artifact generated by the pom
packaging type is itself a POM file.
The following are few examples of Maven parent modules:
Apache Axis2 project: http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/parent/
WSO2 Carbon project: https://svn.wso2.org/repos/wso2/carbon/platform/trunk/parent/
Not all the projects follow this approach. Some just keep the parent POM file under the root directory (not under the parent
module). The following are a couple of examples:
Apache Synapse project: http://svn.apache.org/repos/asf/synapse/trunk/java/pom.xml
Apache HBase project: http://svn.apache.org...