Maven POM

Maven POM

Project Object Model stands for POM. It is a basic work unit in Maven. The XML file is a pom.xml in the project's base directory.

The POM contains project metadata and some configuration details used by Maven to construct the project (s).

POM also includes objectives and plugins. Maven searches for the POM in the current directory while executing a task or objective. It reads the POM, receives the necessary settings and then runs the target. Some of the setups which can be defined in the POM are –

  • project dependencies
  • plugins
  • goals
  • build profiles
  • project version
  • developers
  • mailing list

We should first choose the project group (groupId), its name (artifactId) and version before establishing a POM, as these qualities help in uniqueness in repository identification of the project.

Super POM

Maven's default POM is the Super POM. All POMs are owned or defaulted by parents (despite explicitly defined or not). It contains default-inherited values and is known as the Super POM.

To execute the relevant target, Maven uses the effective POM (super pom configuration plus project configuration). It enables developers to set basic details in their pom.xml configuration. However, it is easy to override configurations.

The following command is a convenient method to check the default Super POM settings: mvn help:effective-pom