Maven POM

Pom File: 

POM is stands for "Project Object Model" is an xml file which contains information about the project which you want to build and configuration details used by MAVEN to build the project.

For example it define the directory structure for your source file and your class file. and also define the location where dependencies related to your project is stored.

POM also contains the goals and plugins. While executing a task or goal, Maven looks for the pom.xml in the current directory.

Some of the configuration that can be specified in the POM are following:
  • project dependencies
  • plugins
  • goals
  • build profiles
  • project version
  • developers
  • mailing list

Sample Pom

There should be a single POM file for each project.

 * project – root element of every pom file.

* modelVersion – The modelVersion element sets what version of the POM        model you are using

* groupId – The groupId element is a unique ID for an organization, or a project

* artifactId – The artifactId element contains the name of the project you are building

* version – The version element contains the version number of the project.

The above groupId, artifactId and version elements would result in a JAR file being built and put into the local Maven repository.

Super POM :

All POMs inherit from a parent (despite explicitly defined or not). This base POM is known as the Super POM, and contains values inherited by default.  

All Maven project POMs extend the Super POM, which defines a set of defaults shared by all projects.

Effective POM :

Maven use the effective pom (super pom + pom.xml ) to execute relevant goal.



Defining Dependency on POM file for your project : sample pom for defining dependencies