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

An XSD is available at:

]]>
package org.apache.maven.model Model ModelBase <project> element specifies various attributes about a project. This is the root element of the project descriptor. The following table lists all of the possible child elements. Child elements with children are then documented further in subsequent sections. ]]> 3.0.0+ extend 3.0.0
<extend>${basedir}/../project.xml</extend>
]]>
String
parent 4.0.0 Parent modelVersion 4.0.0 true String pomVersion 3.0.0 true String id 3.0.0 true jars and distribution files. ]]> String groupId 3.0.0+ true user guide. ]]> String artifactId 3.0.0+ true groupId when naming jars and distribution files. ]]> String packaging 4.0.0 String jar name 3.0.0+ true JavaDoc titles. ]]> String currentVersion jars and distribution files. ]]> 3.0.0 true String version 4.0.0 true String shortDescription 3.0.0 String description 3.0.0+ Mailing Lists of the project's web site, and is shown when maven --usage is called on the project. While this element can be specified as CDATA to enable the use of HTML tags within the description, you are encouraged to provide an alternative home page using xdocs/index.xml if this is required. ]]> String url 3.0.0+ String logo 3.0.0 /images/project-logo.png) or an absolute URL (e.g., http://my.corp/project-logo.png). This is used when generating the project documentation. ]]> String prerequesites 4.0.0 Describes the prerequesites in the build environment for this project. Prerequesites issueTrackingUrl 3.0.0 String issueManagement 4.0.0 IssueManagement ciManagement 4.0.0 CiManagement inceptionYear 3.0.0+ true JavaDoc copyright notices. ]]> String gumpRepositoryId 3.0.0 String siteAddress 3.0.0 deployed. ]]> String siteDirectory 3.0.0 deployed. ]]> String distributionSite 3.0.0 deployed.

If this isn't defined, the central repository is used instead as determined by maven.repo.central and maven.repo.central.directory

]]>
String This naming is inconsistent and distribution should occur from a repository structure.
distributionDirectory 3.0.0 deployed. ]]> String This naming is inconsistent and distribution should occur from a repository structure. mailingLists 3.0.0+ front page of the site's web site. ]]> MailingList * developers 3.0.0+ Project Team page of the project's web site. ]]> Developer * contributors 3.0.0+ Project Team page of the project's web site. ]]> Contributor * licenses 3.0.0+ license element, which is then described by additional elements (described below). The auto-generated site documentation references this information. Projects should only list the license(s) that applies to the project and not the licenses that apply to dependencies. ]]> License * versions 3.0.0 maven:dist target. ]]> Version * branches 3.0.0 maven:dist target. ]]> Branch * packageGroups 3.0.0 PackageGroup * reports 3.0.0 maven site. All of the reports will be included in the navigation bar for browsing in the order they are specified. ]]> String * scm 4.0.0 Scm repository 3.0.0 Repository This element needs to be renamed as it conflicts with the existing notion of repositories in Maven. organization 3.0.0+ Organization properties 3.0.0 Properties String * packageName 3.0.0 String JavaDoc. ]]> build 3.0.0+ true Build profiles 4.0.0 Profile *
3.0.0 4.0.0
ModelBase 3.0.0+ modules 4.0.0 The modules to build in addition to the current project String * repositories 4.0.0 Repository * pluginRepositories 4.0.0 Repository * This may be removed or relocated in the near future. It is undecided whether plugins really need a remote repository set of their own. dependencies 3.0.0+ This element describes all of the dependencies associated with a project. Each dependency is described by a dependency element, which is then described by additional elements (described below).

These dependencies are used to construct a classpath for your project during the build process.

Maven can automatically download these dependencies from a remote repository.

The filename that Maven downloads from the repository is artifactId-version.jar where artifactId corresponds to the artifactId element and version corresponds to the version element.

When Maven goes looking for a dependency in the remote repository, it uses the dependency element to construct the URL to download from. This URL is defined as:

${repo}/${groupId}/${type}s/${artifactId}-${version}.${type}

Where

repo
is the remote repository URL specified by ${maven.repo.remote}
groupId
is taken from the dependency element
type
is taken from the dependency element
artifactId
is taken from the dependency element
version
is taken from the dependency element
]]>
Dependency * These should ultimately only be compile time dependencies when transitive dependencies come into play.
reports 4.0.0 DOM reporting 4.0.0 maven site. All of the reports will be included in the navigation bar for browsing in the order they are specified. ]]> Reporting dependencyManagement 4.0.0 false DependencyManagement distributionManagement 4.0.0 DistributionManagement properties 4.0.0 Properties String *
Branch 3.0.0 maven:dist target. ]]> tag 3.0.0 true String PluginContainer 3.0.0+ plugins 4.0.0 The plugins specified here are not validated until they are referenced in a POM within the group. This allows the specification of a "standard" version for a particular plugin. Plugin * 4.0.0 PluginConfiguration 3.0.0+ PluginContainer pluginManagement 4.0.0 false PluginManagement BuildBase 3.0.0+ PluginConfiguration defaultGoal 3.0.0+ String resources 3.0.0+ below). These resources are used to complete the jar file or to run unit test. ]]> Resource * testResources 4.0.0 below). These resources are used to complete the jar file or to run unit test. ]]> Resource * directory 4.0.0 String finalName 4.0.0 String Build 3.0.0+ BuildBase nagEmailAddress 3.0.0 gump plugin target. ]]> String sourceDirectory 3.0.0+ true String scriptSourceDirectory 4.0.0 true String unitTestSourceDirectory 3.0.0 true String testSourceDirectory 4.0.0 true String aspectSourceDirectory 3.0.0 Aspectj goals document). The path given is relative to the project descriptor. ]]> String integrationUnitTestSourceDirectory 3.0.0 String sourceModifications 3.0.0 true sourceModification element, which is then described by additional elements (described below). These modifications are used to exclude or include various source depending on the environment the build is running in. ]]> SourceModification * unitTest 3.0.0 true new UnitTest() UnitTest outputDirectory 4.0.0 String testOutputDirectory 4.0.0 String extensions 4.0.0 A set of build extensions to use from this project. Extension * CiManagement 4.0.0 system 4.0.0 String url 4.0.0 String notifiers 4.0.0 * Notifier Notifier Configures one method for notifying users/developers when a build breaks. 4.0.0 type 4.0.0 mail String The mechanism used to deliver notifications. address 4.0.0 String Where to send the notification to - eg email address. DEPRECATED. configuration Extended configuration specific to this notifier goes here. Properties String * 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. 3.0.0+ name 3.0.0+ String email 3.0.0+ String url 3.0.0+ String organization 3.0.0+ String organizationUrl 3.0.0+ String roles 3.0.0+ role element, the body of which is a role name. ]]> String * timezone 3.0.0+ String properties 3.0.0+ Properties String * Dependency 3.0.0+ id 3.0.0 true The name of the dependency.

Note: The use of the id element for a dependency is deprecated. Please use groupId and artifactId together instead.

]]>
String
groupId 3.0.0+ true geronimo. ]]> String artifactId 3.0.0+ true germonimo-jms ]]> String version 3.0.0+ 3.2.1 ]]> String url 3.0.0 String The URL should really be gleaned from a shared database of dependency information. jar 3.0.0 String type 3.0.0+ jar. Known recognised dependency types are:
  • jar
  • ejb
  • plugin
]]>
String jar
classifier 4.0.0 The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but were built differently, and is appended to the filename after the version. String false properties 3.0.0 mark dependencies with properties. For example the war plugin looks for a war.bundle property, and if found will include the dependency in WEB-INF/lib. For example syntax, check the war plugin docs. ]]> Properties String * scope 4.0.0 Dependency Mechanism.]]> String systemPath 4.0.0 FOR SYSTEM SCOPE ONLY. This specifies the path on the filesystem for this dependency. String exclusions 4.0.0 Lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to calculating transitive dependencies. Exclusion *
3.0.0 4.0.0 4.0.0 3.0.0 element is explicity used in the POM. if ( getJar() != null) { return getJar(); } String artifact; if ("ejb-client".equals(getType())) { artifact = getArtifactId() + "-" + getVersion() + "-client." + getExtension(); } else { artifact = getArtifactId() + "-" + getVersion() + "." + getExtension(); } return artifact; } public String getTypeDirectory() { String path; if (getType().equals("ejb-client")) { path = "ejbs"; } else { path = getType() + "s"; } return path; } public String getExtension() { if ("ejb".equals(getType()) || "ejb-client".equals(getType()) || "plugin".equals(getType()) || "aspect".equals(getType()) || "uberjar".equals(getType())) return "jar"; return getType(); } public boolean isAddedToClasspath() { return ("jar".equals(getType()) || "ejb".equals(getType()) || "ejb-client".equals(getType()) || "sar".equals(getType())); } public boolean isPlugin() { return ("plugin".equals(getType())); } public String getProperty( String property ) { return getProperties().getProperty( property ); } public boolean equals( Object o ) { if ( this == o ) { return true; } if ( !( o instanceof Dependency ) ) { return false; } Dependency d = (Dependency) o; return getId().equals( d.getId() ); } public int hashCode() { return getId().hashCode(); } ]]>
Contributor Developer Contributor. ]]> 3.0.0+ id 3.0.0+ String Exclusion 4.0.0 artifactId 4.0.0 String true groupId 4.0.0 String true IssueManagement Information about the bugtracking system used to manage this project. 4.0.0 system 4.0.0 String url 4.0.0 String DistributionManagement 4.0.0 repository 4.0.0 RepositoryBase snapshotRepository 4.0.0 Where to deploy snapshots of artifacts to. If not given, it defaults to the repository. RepositoryBase site 4.0.0 Site downloadUrl 4.0.0+ url. ]]> String relocation 4.0.0 Relocation information if the artifact has been moved to a new group/artifactId Relocation status 4.0.0 Gives the status of this artifact in the remote repository. This must not be set in your local project, as it is updated by tools placing it in the reposiory. Valid values are: none (default), converted (repository manager converted this from an Maven 1 POM), partner (directly synced from a partner Maven 2 repository), deployed (was deployed from a Maven 2 instance), verified (has been hand verified as correct and final). false String License License page of the project's web site. Typically the licenses listed for the project are that of the project itself, and not of dependencies. ]]> 3.0.0+ name 3.0.0+ String url 3.0.0+ String distribution 3.0.0+
repo
may be downloaded from the Maven repository
manual
user must manually download and install the dependency.
]]>
String
comments Addendum information pertaining to this license. 3.0.0+ String
MailingList 3.0.0+ mailingList element, which is then described by additional elements (described below). The auto-generated site documentation references this information. ]]> name 3.0.0+ String subscribe 3.0.0+ mailto: link will automatically be created when the documentation is created. ]]> String unsubscribe 3.0.0+ mailto: link will automatically be created when the documentation is created. ]]> String post 3.0.0+ mailto: link will automatically be created when the documentation is created. ]]> String archive 3.0.0+ String otherArchives 3.0.0+ String * We could probably have a specific element for a dev mailing list for things like CI, and maybe even a specific element for the user and scm mailing lists. Then leave the more lose structure for any other type of mailing list. Organization Specifies the organization who produces this project. 3.0.0+ name 3.0.0+ String url 3.0.0+ String logo 3.0.0 /images/org-logo.png) or an absolute URL (e.g., http://my.corp/logo.png). This value is used when generating the project documentation. ]]> String PackageGroup 3.0.0 title 3.0.0 String packages 3.0.0 String PatternSet 3.0.0+ includes 3.0.0+ String * excludes 3.0.0+ String * Parent 4.0.0 artifactId 4.0.0 true String groupId 4.0.0 true String version 4.0.0 String relativePath 4.0.0 String ../pom.xml Repository 3.0.0 connection 3.0.0 Optional. The source configuration management system URL that describes the repository and how to connect to the repository. This is used by Maven when building versions from specific ID.

The format of this element is as follows:

scm:<provider>:<provider-parameters>

For cvs, the format for pserver repositories should be:

scm:cvs:pserver:user@host:/cvs/root:module-name

For local networked repositories (eg. pserver to local machine)

scm:cvs:lserver:user@host:/cvs/root:module-name

For ssh access:

scm:cvs:ext:user@host:/cvs/root:module-name
Remember that CVS will expect an environment variable called CVS_RSH to be set, typically to ssh or your ssh client.

Some cvs clients support other protocols, such as ntserver and extssh. Here's an example using CVS NT and ntserver:

scm|cvs|ntserver|user@server|e:\cvs|Deployment
Note the use of the vertical bar as delimiter as the repository has a colon (:) in it.

For local file system repositories

scm:cvs:local:ignored:/cvs/root:module-name

For StarTeam access:

scm:starteam:username:password@host:port/project/view/folder
All of this information can be had from either the StarTeam Universal Client (Tools->Server Administration->Server Properties) or from the administrator.

The delimiter is determined by the character after "scm". eg. scm|cvs|pserver|user@host|/cvs/root|module-name is equivalent to that listed above. This can be useful for Windows users who have : in their cvsroot parameter (eg. D:\cvsroot)

Where pserver is the protocol used to access CVS, user@host is the user name to log in to the specified cvs host, /cvs/root is the cvs root directory, and module-name is the name of the cvs module to be worked on

As an example, the settings for an Apache project are usually:

scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:module-name

Currently CVS, Starteam and SubVersion are the only supported scm's. Others will be added as soon as possible

]]>
String
developerConnection 3.0.0 String url 3.0.0 String
Scm 4.0.0 connection 4.0.0 building versions from specific ID. ]]> String developerConnection 4.0.0 String tag 4.0.0 String HEAD url 4.0.0 String FileSet 3.0.0+ PatternSet directory 3.0.0+ String Resource below). These resources are used to complete the jar file or to run unit test. ]]> 3.0.0+ FileSet targetPath 3.0.0+ org.apache.maven.messages), you must specify this element with this value : org/apache/maven/messages ]]> String filtering 3.0.0+ boolean false SourceModification sourceModification element, which is then described by additional elements (described below). These modifications are used to exclude or include various source depending on the environment the build is running in. ]]> 3.0.0 FileSet className 3.0.0 not be loaded, then the includes and excludes specified below will be applied to the contents of the sourceDirectory ]]> String property 3.0.0 String UnitTest 3.0.0 PatternSet resources 3.0.0 Resource * Version 3.0.0 version element ]]> name 3.0.0 1.0, 1.1-alpha1, 1.2-beta, 1.3.2 etc. ]]> String tag 3.0.0 String id 3.0.0 maven:dist builds. ]]> String 3.0.0 RepositoryBase 4.0.0 id 4.0.0 String name 4.0.0 String url 4.0.0 String layout 4.0.0 The type of layout this repository uses for locating and storing artifacts - can be "legacy" or "default". String default 4.0.0 Repository RepositoryBase 4.0.0 Repository contains the information needed for establishing connections with remote repoistory snapshotPolicy 4.0.0 The policy for downloading snapshots - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (repository is not checked, even if the snapshot is not present locally). String checksumPolicy 4.0.0 What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are "fail" or "warn" String releases 4.0.0 How to handle downloading of releases from this repository RepositoryPolicy snapshots 4.0.0 How to handle downloading of snapshots from this repository RepositoryPolicy 4.0.0 RepositoryPolicy 4.0.0 Download policy enabled 4.0.0 Whether to use this repository for downloading this type of artifact boolean true updatePolicy 4.0.0 The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (only if it doesn't exist locally). String checksumPolicy 4.0.0 What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are "fail" or "warn" String Site 4.0.0 id 4.0.0 String name 4.0.0 String url 4.0.0 String ConfigurationContainer 4.0.0 inherited 4.0.0 String configuration DOM 4.0.0 Plugin 4.0.0 ConfigurationContainer groupId 4.0.0 String true org.apache.maven.plugins artifactId 4.0.0 String true version 4.0.0 true String extensions 4.0.0 boolean Whether to load Maven extensions (such as packaging and type handlers) from this plugin false executions 4.0.0 Multiple specifications of a set of goals, each having (possibly) different configuration PluginExecution * goals 4.0.0 Goal * 4.0.0 elements.\nOffending execution\n\nId: \'" + exec.getId() + "\'\nPlugin:\'" + getKey() + "\'\n\n" ); } executionMap.put( exec.getId(), exec ); } } } return executionMap; } public String getKey() { return constructKey( groupId, artifactId ); } public static String constructKey( String groupId, String artifactId ) { return groupId + ":" + artifactId; } /** @deprecated */ private Map goalMap = null; /** @deprecated */ public void flushGoalMap() { this.goalMap = null; } /** @deprecated */ public Map getGoalsAsMap() { if ( goalMap == null ) { goalMap = new HashMap(); if ( goals != null ) { for ( Iterator i = goals.iterator(); i.hasNext(); ) { Goal g = (Goal) i.next(); goalMap.put( g.getId(), g ); } } } return goalMap; } ]]> PluginExecution 4.0.0 ConfigurationContainer id 4.0.0 true String default phase 4.0.0 String goals 4.0.0 String * Goal 4.0.0 id 4.0.0 String configuration DOM DependencyManagement 4.0.0 Section for management of default dependency information for use in a group of POMs. dependencies 4.0.0 The dependencies specified here are not validated until they are referenced in a POM within the group. This allows the specification of a "standard" version for a particular dependency. Dependency * PluginManagement 4.0.0 PluginContainer Section for management of default plugin information for use in a group of POMs. Reporting 4.0.0 Section for management of reports and configuration outputDirectory 4.0.0 String Where to store all of the generated reports plugins 4.0.0 The report plugins) to use and their configuration ReportPlugin * 4.0.0 Profile ModelBase 4.0.0 id true 4.0.0 String The ID of this build profile, for activation purposes. activation 4.0.0 Activation build 4.0.0 true BuildBase 4.0.0 Activation 4.0.0 jdk 4.0.0 String property 4.0.0 ActivationProperty file 4.0.0 ActivationFile ActivationProperty 4.0.0 name 4.0.0 String true The name of the property to be used to activate a profile value 4.0.0 String The value of the property to be used to activate a profile ActivationFile 4.0.0 missing 4.0.0 String The name of the file that should be missing to activate a profile exists 4.0.0 String The name of the file that should exist to activate a profile ReportPlugin 4.0.0 groupId 4.0.0 String true org.apache.maven.plugins artifactId 4.0.0 String true version 4.0.0 String inherited 4.0.0 String configuration 4.0.0 DOM reportSets 4.0.0 Multiple specifications of a set of reports, each having (possibly) different configuration ReportSet * 4.0.0 ReportSet 4.0.0 Represents a set of reports and configuration to be used to generate them. id String true The unique id for this report set, to be used during POM inheritance. configuration 4.0.0 DOM inherited 4.0.0 String reports 4.0.0 true String * 4.0.0 Prerequesites 4.0.0 Describes the prerequesites a project can have maven 4.0.0 String 2.0-beta-1-SNAPSHOT The minimum version of Maven required false Relocation 4.0.0 Describes where an artifact has moved to. If any of the values are omitted, it is assumed to be the same as it was before. groupId 4.0.0 The group the artifact has moved to String artifactId 4.0.0 The new artifact ID of the artifact String version 4.0.0 The new version of the artifact String message 4.0.0 An additional message to show the user about the move, such as the reason. String Extension 4.0.0 Describes a build extension to utilise groupId 4.0.0 The group of the extension's artifact. true String artifactId 4.0.0 The artifact ID of the extension true String version 4.0.0 The version of the extension String 4.0.0