Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Validating your POM

The pom:validate goal performs a validation of your project descriptor (project.xml, pom) against an xsd schema. The general form of a project descriptor can be found on the main Maven site.

WARNING: for the pom:validate goal to work, your project descriptor (project.xml) has to be at least parsable and well-formed in the first place (chicken or egg?). If your pom is not well-formed, Maven will fail with a (hopefully useful) error message before any plugin starts to work. If you are having problems getting Maven to run, you should try to validate your pom with an independent xml validation tool first.

Namespace

In order to be valid, your project.xml file needs to include a namespace declaration in the project root element:

<project xmlns="http://maven.apache.org/POM/3.0.0">

or

<project xmlns="http://maven.apache.org/POM/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/3.0.0 http://maven.apache.org/maven-v3_0_0.xsd">

Required elements

The validation routine works differently for stand-alone poms and poms that extend other ones (child poms). The following table shows which top-level elements (i.e., elements just below the <project> root) are required in each case.

Element name Required in stand-alone pom? Required in child pom? Remarks
<extend/> N/AYes
<pomVersion/> YesNo
<id/> NoNoDeprecated, use <groupId/> and <artifactId/> instead.
<groupId/> YesNo
<artifactId/> YesNo
<name/> YesNo
<currentVersion/> YesNo
<description/> NoNo
<shortDescription/> NoNo
<url/> NoNo
<logo/> NoNo
<issueTrackingUrl/> NoNo
<inceptionYear/> YesNo
<gumpRepositoryId/> NoNo
<siteAddress/> NoNo
<siteDirectory/> NoNo
<distributionSite/> NoNo
<distributionDirectory/> NoNo
<mailingLists> NoNo
<developers> NoNo
<contributors> NoNo
<licenses> NoNo
<versions> NoNo
<branches> NoNo
<packageGroups> NoNo
<reports> NoNo
<repository> NoNo
<organization> NoNo
<properties> NoNo
<package/> NoNo
<build> NoNo
<dependencies> NoNo