Defining a parent module
In most of the multi-module Maven projects, there are many things that are shared across multiple modules. Dependency versions, plugins versions, properties, and repositories are only some of them. It is a common as well as a best practice to create a separate module called parent, and in its POM file, define everything in common. 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 a few examples:
The Apache Axis2 project, available at http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/parent/
The WSO2 Carbon project, available at 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:
The Apache Synapse project, available at http://svn.apache.org/repos/asf/synapse/trunk/java/pom.xml
The Apache HBase...