Table of Contents

Maven - pom.xml - Project Object Model

About

pom.xml is an XML representation of a Maven project known also as the project descriptor.

It is ultimately a project declaration. Where as a build.xml tells ant precisely what to do when it is run (procedural), a POM states its configuration (declarative).

The POM is the basic unit of work in Maven.

You can create it:

Definition of:

See

Simple POM

<project 
  xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>my-app</name>
  <url>http://maven.apache.org</url>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
</project>

where:

Description/Documentation Element:

Third party integration

Ant

The target fetchDependencies of an ant build script looks at the required dependencies, looks at maven's dependency cache (in the user's home directory) and downloads the dependency jar files from one of the maven repositories to the shared dependency cache.

Eclipse

To convert pom.xml to a project file for an IDE, you can use the utility mvn:

Idea

IDEA - Maven

Documentation / Reference