MavenConsumer

This is a reference for the Maven Consumer project descriptor used in Maven.

An XSD is available at:

<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/xsd/maven-consumer-4.0.0.xsd">
  <modelVersion/>

  <groupId/>
  <artifactId/>
  <version/>
  <packaging/>

  <name/>
  <description/>
  <url/>
  <inceptionYear/>
  <organization>
    <name/>
    <url/>
  </organization>
  <licenses>
    <license>
      <name/>
      <url/>
      <distribution/>
      <comments/>
    </license>
  </licenses>

  <developers>
    <developer>
      <id/>
      <name/>
      <email/>
      <url/>
      <organization/>
      <organizationUrl/>
      <roles/>
      <timezone/>
      <properties>
        <key>value</key>
      </properties>
    </developer>
  </developers>
  <contributors>
    <contributor>
      <name/>
      <email/>
      <url/>
      <organization/>
      <organizationUrl/>
      <roles/>
      <timezone/>
      <properties>
        <key>value</key>
      </properties>
    </contributor>
  </contributors>

  <mailingLists>
    <mailingList>
      <name/>
      <subscribe/>
      <unsubscribe/>
      <post/>
      <archive/>
      <otherArchives/>
    </mailingList>
  </mailingLists>

  <prerequisites>
    <maven/>
  </prerequisites>

  <scm>
    <connection/>
    <developerConnection/>
    <tag/>
    <url/>
  </scm>
  <issueManagement>
    <system/>
    <url/>
  </issueManagement>

  <dependencies>
    <dependency>
      <groupId/>
      <artifactId/>
      <version/>
      <type/>
      <classifier/>
      <scope/>
      <systemPath/>
      <exclusions>
        <exclusion>
          <artifactId/>
          <groupId/>
        </exclusion>
      </exclusions>
      <optional/>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <releases>
        <enabled/>
        <updatePolicy/>
        <checksumPolicy/>
      </releases>
      <snapshots>
        <enabled/>
        <updatePolicy/>
        <checksumPolicy/>
      </snapshots>
      <id/>
      <name/>
      <url/>
      <layout/>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id/>
      <activation>
        <activeByDefault/>
        <jdk/>
        <os>
          <name/>
          <family/>
          <arch/>
          <version/>
        </os>
      </activation>

      <dependencies>
        <dependency>
          <groupId/>
          <artifactId/>
          <version/>
          <type/>
          <classifier/>
          <scope/>
          <systemPath/>
          <exclusions>
            <exclusion>
              <artifactId/>
              <groupId/>
            </exclusion>
          </exclusions>
          <optional/>
        </dependency>
      </dependencies>

      <repositories>
        <repository>
          <releases>
            <enabled/>
            <updatePolicy/>
            <checksumPolicy/>
          </releases>
          <snapshots>
            <enabled/>
            <updatePolicy/>
            <checksumPolicy/>
          </snapshots>
          <id/>
          <name/>
          <url/>
          <layout/>
        </repository>
      </repositories>
    </profile>
  </profiles>
</project>

project

The <project> element is the root of the descriptor. The following table lists all of the possible child elements.

Element Type Description
modelVersion String Declares to which version of project descriptor this POM conforms.
groupId String A universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other projects with a similar name (eg. org.apache.maven).
artifactId String The identifier for this artifact that is unique within the group given by the group ID. An artifact is something that is either produced or used by a project. Examples of artifacts produced by Maven for a project include: JARs, source and binary distributions, and WARs.
version String The current version of the artifact produced by this project.
packaging String The type of artifact this project produces, for example jar war ear pom. Plugins can create their own packaging, and therefore their own packaging types, so this list does not contain all possible types.
Default value is: jar.
name String The full name of the project.
description String A detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site. While this element can be specified as CDATA to enable the use of HTML tags within the description, it is discouraged to allow plain text representation. If you need to modify the index page of the generated web site, you are able to specify your own instead of adjusting this text.
url String The URL to the project's homepage.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property)
inceptionYear String The year of the project's inception, specified with 4 digits. This value is used when generating copyright notices as well as being informational.
organization Organization This element describes various attributes of the organization to which the project belongs. These attributes are utilized when documentation is created (for copyright notices and links).
licenses/license* List<License> (Many) This element describes all of the licenses for this project. Each license is described by a license element, which is then described by additional elements. Projects should only list the license(s) that applies to the project and not the licenses that apply to dependencies. If multiple licenses are listed, it is assumed that the user can select any of them, not that they must accept all.
developers/developer* List<Developer> (Many) Describes the committers of a project.
contributors/contributor* List<Contributor> (Many) Describes the contributors to a project that are not yet committers.
mailingLists/mailingList* List<MailingList> (Many) Contains information about a project's mailing lists.
prerequisites Prerequisites Describes the prerequisites in the build environment for this project.
scm Scm Specification for the SCM used by the project, such as CVS, Subversion, etc.
issueManagement IssueManagement The project's issue management system information.
dependencies/dependency* List<Dependency> (Many) This element describes all of the dependencies associated with a project. These dependencies are used to construct a classpath for your project during the build process. They are automatically downloaded from the repositories defined in this project. See the dependency mechanism for more information.
repositories/repository* List<Repository> (Many) The lists of the remote repositories for discovering dependencies and extensions.
profiles/profile* List<Profile> (Many) A listing of project-local build profiles which will modify the build process when activated.

organization

Specifies the organization that produces this project.

Element Type Description
name String The full name of the organization.
url String The URL to the organization's home page.

license

Describes the licenses for this project. This is used to generate the license page of the project's web site, as well as being taken into consideration in other reporting and validation. The licenses listed for the project are that of the project itself, and not of dependencies.

Element Type Description
name String The full legal name of the license.
url String The official url for the license text.
distribution String The primary method by which this project may be distributed.
repo
may be downloaded from the Maven repository
manual
user must manually download and install the dependency.
comments String Addendum information pertaining to this license.

developer

Information about one of the committers on this project.

Element Type Description
id String The unique ID of the developer in the SCM.
name String The full name of the contributor.
email String The email address of the contributor.
url String The URL for the homepage of the contributor.
organization String The organization to which the contributor belongs.
organizationUrl String The URL of the organization.
roles/role* List<String> (Many) The roles the contributor plays in the project. Each role is described by a role element, the body of which is a role name. This can also be used to describe the contribution.
timezone String The timezone the contributor is in. Typically, this is a number in the range -12 to +14 or a valid time zone id like "America/Montreal" (UTC-05:00) or "Europe/Paris" (UTC+01:00).
properties/key=value* Properties (Many) Properties about the contributor, such as an instant messenger handle.

contributor

Description of a person who has contributed to the project, but who does not have commit privileges. Usually, these contributions come in the form of patches submitted.

Element Type Description
name String The full name of the contributor.
email String The email address of the contributor.
url String The URL for the homepage of the contributor.
organization String The organization to which the contributor belongs.
organizationUrl String The URL of the organization.
roles/role* List<String> (Many) The roles the contributor plays in the project. Each role is described by a role element, the body of which is a role name. This can also be used to describe the contribution.
timezone String The timezone the contributor is in. Typically, this is a number in the range -12 to +14 or a valid time zone id like "America/Montreal" (UTC-05:00) or "Europe/Paris" (UTC+01:00).
properties/key=value* Properties (Many) Properties about the contributor, such as an instant messenger handle.

mailingList

This element describes all of the mailing lists associated with a project. The auto-generated site references this information.

Element Type Description
name String The name of the mailing list.
subscribe String The email address or link that can be used to subscribe to the mailing list. If this is an email address, a mailto: link will automatically be created when the documentation is created.
unsubscribe String The email address or link that can be used to unsubscribe to the mailing list. If this is an email address, a mailto: link will automatically be created when the documentation is created.
post String The email address or link that can be used to post to the mailing list. If this is an email address, a mailto: link will automatically be created when the documentation is created.
archive String The link to a URL where you can browse the mailing list archive.
otherArchives/otherArchive* List<String> (Many) The link to alternate URLs where you can browse the list archive.

prerequisites

Describes the prerequisites a project can have.

Element Type Description
maven String For a plugin project (packaging is maven-plugin), the minimum version of Maven required to use the resulting plugin.
In Maven 2, this was also specifying the minimum version of Maven required to build a project, but this usage is deprecated in Maven 3 and not checked any more: use the Maven Enforcer Plugin's requireMavenVersion rule instead.
Default value is: 2.0.

scm

The <scm> element contains informations required to the SCM (Source Control Management) of the project.

Element Type Description
connection String The source control management system URL that describes the repository and how to connect to the repository. For more information, see the URL format and list of supported SCMs. This connection is read-only.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property)
developerConnection String Just like connection, but for developers, i.e. this scm connection will not be read only.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property)
tag String The tag of current code. By default, it's set to HEAD during development.
Default value is: HEAD.
url String The URL to the project's browsable SCM repository, such as ViewVC or Fisheye.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property)

issueManagement

Information about the issue tracking (or bug tracking) system used to manage this project.

Element Type Description
system String The name of the issue management system, e.g. Bugzilla
url String URL for the issue management system used by the project.

dependency

The <dependency> element contains information about a dependency of the project.

Element Type Description
groupId String The project group that produced the dependency, e.g. org.apache.maven.
artifactId String The unique id for an artifact produced by the project group, e.g. maven-artifact.
version String The version of the dependency, e.g. 3.2.1. In Maven 2, this can also be specified as a range of versions.
type String The type of dependency. While it usually represents the extension on the filename of the dependency, that is not always the case. A type can be mapped to a different extension and a classifier. The type often corresponds to the packaging used, though this is also not always the case. Some examples are jar, war, ejb-client and test-jar: see default artifact handlers for a list. New types can be defined by plugins that set extensions to true, so this is not a complete list.
Default value is: jar.
classifier String The classifier of the dependency. It is appended to the filename after the version. This allows:
  • referring to attached artifact, for example sources and javadoc: see default artifact handlers for a list,
  • distinguishing two artifacts that belong to the same POM but were built differently. For example, jdk14 and jdk15.
scope String The scope of the dependency - compile, runtime, test, system, and provided. Used to calculate the various classpaths used for compilation, testing, and so on. It also assists in determining which artifacts to include in a distribution of this project. For more information, see the dependency mechanism. The default scope is compile.
systemPath String FOR SYSTEM SCOPE ONLY. Note that use of this property is discouraged and may be replaced in later versions. This specifies the path on the filesystem for this dependency. Requires an absolute path for the value, not relative. Use a property that gives the machine specific absolute path, e.g. ${java.home}.
exclusions/exclusion* List<Exclusion> (Many) Lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to calculating transitive dependencies.
optional String Indicates the dependency is optional for use of this library. While the version of the dependency will be taken into account for dependency calculation if the library is used elsewhere, it will not be passed on transitively. Note: While the type of this field is String for technical reasons, the semantic type is actually Boolean. Default value is false.

exclusion

The <exclusion> element contains informations required to exclude an artifact to the project.

Element Type Description
artifactId String The artifact ID of the project to exclude.
groupId String The group ID of the project to exclude.

repository

A repository contains the information needed for establishing connections with remote repository.

Element Type Description
releases RepositoryPolicy How to handle downloading of releases from this repository.
snapshots RepositoryPolicy How to handle downloading of snapshots from this repository.
id String A unique identifier for a repository. This is used to match the repository to configuration in the settings.xml file, for example. Furthermore, the identifier is used during POM inheritance and profile injection to detect repositories that should be merged.
name String Human readable name of the repository.
url String The url of the repository, in the form protocol://hostname/path.
layout String The type of layout this repository uses for locating and storing artifacts - can be legacy or default.
Default value is: default.

releases

Download policy.

Element Type Description
enabled String Whether to use this repository for downloading this type of artifact. Note: While the type of this field is String for technical reasons, the semantic type is actually Boolean. Default value is true.
updatePolicy String The frequency for downloading updates - can be always, daily (default), interval:XXX (in minutes) or never (only if it doesn't exist locally).
checksumPolicy String What to do when verification of an artifact checksum fails. Valid values are ignore , fail or warn (the default).

snapshots

Download policy.

Element Type Description
enabled String Whether to use this repository for downloading this type of artifact. Note: While the type of this field is String for technical reasons, the semantic type is actually Boolean. Default value is true.
updatePolicy String The frequency for downloading updates - can be always, daily (default), interval:XXX (in minutes) or never (only if it doesn't exist locally).
checksumPolicy String What to do when verification of an artifact checksum fails. Valid values are ignore , fail or warn (the default).

profile

Modifications to the build process which is activated based on environmental parameters or command line arguments.

Element Type Description
id String The identifier of this build profile. This is used for command line activation, and identifies profiles to be merged.
Default value is: default.
activation Activation The conditional logic which will automatically trigger the inclusion of this profile.
dependencies/dependency* List<Dependency> (Many) This element describes all of the dependencies associated with a project. These dependencies are used to construct a classpath for your project during the build process. They are automatically downloaded from the repositories defined in this project. See the dependency mechanism for more information.
repositories/repository* List<Repository> (Many) The lists of the remote repositories for discovering dependencies and extensions.

activation

The conditions within the build runtime environment which will trigger the automatic inclusion of the build profile. Multiple conditions can be defined, which must be all satisfied to activate the profile.

Element Type Description
activeByDefault boolean If set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.
Default value is: false.
jdk String Specifies that this profile will be activated when a matching JDK is detected. For example, 1.4 only activates on JDKs versioned 1.4, while !1.4 matches any JDK that is not version 1.4. Ranges are supported too: [1.5,) activates when the JDK is 1.5 minimum.
os ActivationOS Specifies that this profile will be activated when matching operating system attributes are detected.

os

This is an activator which will detect an operating system's attributes in order to activate its profile.

Element Type Description
name String The name of the operating system to be used to activate the profile. This must be an exact match of the ${os.name} Java property, such as Windows XP.
family String The general family of the OS to be used to activate the profile, such as windows or unix.
arch String The architecture of the operating system to be used to activate the profile.
version String The version of the operating system to be used to activate the profile.