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 is the root of the descriptor. The following table lists all of the possible child elements. ]]> 3.0.0+ extend 3.0.0 project.xml file. For example, <extend>${basedir}/../project.xml</extend>. ]]> String parent 4.0.0 Parent modelVersion 4.0.0 true String pomVersion 3.0.0 true String 3. ]]> groupId 3.0.0+ true org.apache.maven). ]]> String artifactId 3.0.0+ true String id 3.0.0 true Deprecated. When used, this sets both the groupId and artifactId elements if they were previously empty. ]]> String packaging 4.0.0 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. ]]> String jar name 3.0.0+ true String currentVersion 3.0.0 true String version 4.0.0 true String shortDescription 3.0.0 String description 3.0.0+ 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 prerequisites 4.0.0 Describes the prerequisites in the build environment for this project. Prerequisites issueTrackingUrl 3.0.0 String issueManagement 4.0.0 IssueManagement ciManagement 4.0.0 CiManagement inceptionYear 3.0.0+ true String gumpRepositoryId 3.0.0 String siteAddress 3.0.0 String siteDirectory 3.0.0 String distributionSite 3.0.0 maven.repo.central and maven.repo.central.directory. ]]> String distributionDirectory 3.0.0 String mailingLists 3.0.0+ MailingList * developers 3.0.0+ Developer * contributors 3.0.0+ Contributor * licenses 3.0.0+ 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. ]]> License * versions 3.0.0 Version * branches 3.0.0 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 organization 3.0.0+ organisation Organization properties 3.0.0 <name>value</name>. ]]> Properties String * packageName 3.0.0 String build 3.0.0+ true Build profiles 4.0.0 Profile * 3.0.0 4.0.0 groupId:artifactId:packaging:version */ public String getId() { StringBuffer id = new StringBuffer(); id.append( getGroupId() ); id.append( ":" ); id.append( getArtifactId() ); id.append( ":" ); id.append( getPackaging() ); id.append( ":" ); id.append( getVersion() ); return id.toString(); } ]]> ModelBase 3.0.0+ Model and the Profile objects. ]]> modules 4.0.0 The modules (sometimes called subprojects) to build as a part of this project. Each module listed is a relative path to the directory containing the module. String * repositories 4.0.0 Repository * pluginRepositories 4.0.0 Repository * dependencies 3.0.0+ the dependency mechanism for more information. ]]> Dependency * reports 4.0.0 Deprecated. Now ignored by Maven. ]]> DOM reporting 4.0.0 mvn site. All of the reports will be included in the navigation bar for browsing. ]]> Reporting dependencyManagement 4.0.0 false DependencyManagement distributionManagement 4.0.0 DistributionManagement properties 4.0.0 <name>value</name>. ]]> Properties String * Branch 3.0.0 tag 3.0.0 true String PluginContainer 3.0.0+ plugins 4.0.0 The list of plugins to use. Plugin * 4.0.0 pluginsMap field to null */ public void flushPluginMap() { this.pluginMap = null; } /** * @return a Map of plugins field with Plugins#getKey() as key * @see org.apache.maven.model.Plugin#getKey() */ public java.util.Map getPluginsAsMap() { if ( pluginMap == null ) { pluginMap = new java.util.HashMap(); if ( plugins != null ) { for ( java.util.Iterator it = plugins.iterator(); it.hasNext(); ) { Plugin plugin = (Plugin) it.next(); pluginMap.put( plugin.getKey(), plugin ); } } } return pluginMap; } ]]> 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+ Resource * testResources 4.0.0 Resource * directory 4.0.0 String finalName 4.0.0 ${artifactId}-${version}. ]]> String filters 4.0.0 String * Build 3.0.0+ BuildBase <build> element contains informations required to build the project. ]]> nagEmailAddress 3.0.0 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 String integrationUnitTestSourceDirectory 3.0.0 String sourceModifications 3.0.0 true 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 <CiManagement> element contains informations required to the continuous integration system of the project. ]]> system 4.0.0 continuum. ]]> 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. sendOnError 4.0.0 true boolean Whether to send notifications on error. sendOnFailure 4.0.0 true boolean Whether to send notifications on failure. sendOnSuccess 4.0.0 true boolean Whether to send notifications on success. sendOnWarning 4.0.0 true boolean Whether to send notifications on warning. address 4.0.0 String Deprecated. Where to send the notification to - eg email address. ]]> 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 organisation 3.0.0+ String organizationUrl organisationUrl 3.0.0+ String roles 3.0.0+ role element, the body of which is a role name. This can also be used to describe the contribution. ]]> String * timezone 3.0.0+ String properties 3.0.0+ Properties String * Dependency 3.0.0+ <dependency> element contains informations required to a dependency of the project. ]]> id 3.0.0 true Deprecated. Please use groupId and artifactId together instead. ]]> String groupId 3.0.0+ true org.apache.maven. ]]> String artifactId 3.0.0+ true maven-artifact. ]]> String version 3.0.0+ 3.2.1. In Maven 2, this can also be specified as a range of versions. ]]> String url 3.0.0 String jar 3.0.0 String type 3.0.0 jar. While it usually represents the extension on the filename of the dependency, that is not always the case. Some examples are jar, war, and plugin. A dependency of type plugin is loaded as a Maven plugin and not added to the project build classpath. ]]> String jar type 4.0.0 jar. 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 correspongs to the packaging used, though this is also not always the case. Some examples are jar, war, ejb-client and test-jar. New types can be defined by plugins that set extensions to true, so this is not a complete list. ]]> String jar classifier 4.0.0 jdk14 and jdk15. ]]> String false properties 3.0.0 war.bundle property, and if found will include the dependency in WEB-INF/lib. ]]> Properties String * scope 4.0.0 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. ]]> String systemPath 4.0.0 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}. ]]> 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 * optional 4.0.0 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. boolean false 3.0.0 4.0.0 4.0.0 groupId:artifactId:type */ public String getManagementKey() { return groupId + ":" + artifactId + ":" + type + ( classifier != null ? ":" + classifier : "" ); } ]]> 3.0.0 id:type */ public String getKey() { return getId() + ":" + getType(); } /** * @return the groupId as artifact directory */ public String getArtifactDirectory() { return getGroupId(); } /** * @return the artifact name as artifactId-version.extension if <jar/> not set */ public String getArtifact() { // If the jar name has been explicty set then use that. This // is when the 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 ); } /** * @see java.lang.Object#equals(java.lang.Object) */ 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() ); } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return getId().hashCode(); } ]]> Contributor Developer 3.0.0+ id 3.0.0+ String Exclusion 4.0.0 <exclusion> element contains informations required to exclude an artifact to the project. ]]> artifactId 4.0.0 String true groupId 4.0.0 String true IssueManagement Information about the issue tracking (or bug tracking) 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 DeploymentRepository snapshotRepository 4.0.0 repository element. ]]> DeploymentRepository site 4.0.0 Site downloadUrl 4.0.0+ url. This is given to assist in locating artifacts that are not in the repository due to licensing restrictions. ]]> String relocation 4.0.0 Relocation information of the artifact if it has been moved to a new group ID and/or artifact ID. Relocation status 4.0.0 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 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+ 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 that 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 A JavaDoc package group. title 3.0.0 String packages 3.0.0 String PatternSet 3.0.0+ includes 3.0.0+ **/*.xml. ]]> String * excludes 3.0.0+ **/*.xml ]]> String * Parent 4.0.0 <parent> element contains informations required to the parent project. ]]> artifactId 4.0.0 true String groupId 4.0.0 true String version 4.0.0 String relativePath 4.0.0 pom.xml file within the check out. The default value is ../pom.xml. Maven looks for the parent pom first in the reactor of currently building projects, then in this location on the filesystem, then the local repository, and lastly in the remote repo. relativePath allows you to select a different location, for example when your structure is flat, or deeper without an intermediate parent pom. However, the group ID, artifact ID and version are still required, and must match the file in the location given or it will revert to the repository for the POM. This feature is only for enhancing the development in a local checkout of that project. ]]> String ../pom.xml 4.0.0 groupId:artifactId:version */ public String getId() { StringBuffer id = new StringBuffer(); id.append( getGroupId() ); id.append( ":" ); id.append( getArtifactId() ); id.append( ":" ); // id.append( getPackaging() ); id.append( ":" ); id.append( getVersion() ); return id.toString(); } ]]> Repository 3.0.0 <repository> element contains informations required to a repository used by the project. ]]> connection 3.0.0 URL format and list of supported SCMs. This connection is read-only. ]]> String developerConnection 3.0.0 connection, but for developers, i.e. this scm connection will not be read only. ]]> String url 3.0.0 String Scm 4.0.0 <scm> element contains informations required to the SCM (Source Control Management) of the project. ]]> connection 4.0.0 URL format and list of supported SCMs. This connection is read-only. ]]> String developerConnection 4.0.0 connection, but for developers, i.e. this scm connection will not be read only. ]]> String tag 4.0.0 String HEAD url 4.0.0 String FileSet 3.0.0+ PatternSet directory 3.0.0+ String Resource 3.0.0+ FileSet targetPath 3.0.0+ org.apache.maven.messages), you must specify this element with this value: org/apache/maven/messages. This is not required if you simply put the resources in that directory structure at the source, however. ]]> String filtering 3.0.0+ properties element and from the properties in the files listed in the filters element. ]]> boolean false SourceModification 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 not set, then the includes and excludes specified below will be applied to the contents of the sourceDirectory. ]]> 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 String 3.0.0 RepositoryBase 4.0.0 id 4.0.0 settings.xml file, for example. ]]> String name 4.0.0 String url 4.0.0 protocol://hostname/path. ]]> String layout 4.0.0 legacy or default. ]]> String default 4.0.0 Repository RepositoryBase 4.0.0 A repository contains the information needed for establishing connections with remote repository. 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 DeploymentRepository RepositoryBase 4.0.0 Repository contains the information needed for deploying to the remote repository. uniqueVersion Whether to assign snapshots a unique version comprised of the timestamp and build number, or to use the same version each time boolean true 4.0.0 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 always, daily (default), interval:XXX (in minutes) or never (only if it doesn't exist locally). ]]> String checksumPolicy 4.0.0 ignore , fail or warn (the default). ]]> String Site 4.0.0 id 4.0.0 settings.xml file, for example. ]]> String name 4.0.0 String url 4.0.0 protocol://hostname/path. ]]> String ConfigurationContainer 4.0.0 inherited 4.0.0 String configuration DOM 4.0.0 Plugin 4.0.0 ConfigurationContainer <plugin> element contains informations required for a plugin. ]]> groupId The group ID of the plugin in the repository. 4.0.0 String true org.apache.maven.plugins artifactId The artifact ID of the plugin in the repository. 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. For performance reasons, this should only be enabled when necessary. false executions 4.0.0 Multiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) different configuration. PluginExecution * dependencies Additional dependencies that this project needs to introduce to the plugin's classloader. 4.0.0 Dependency * goals 4.0.0 Deprecated. Unused by Maven. ]]> DOM 4.0.0 executionMap field to null */ public void flushExecutionMap() { this.executionMap = null; } /** * @return a Map of executions field with PluginExecution#getId() as key * @see org.apache.maven.model.PluginExecution#getId() */ public java.util.Map getExecutionsAsMap() { if ( executionMap == null ) { executionMap = new java.util.HashMap(); if ( getExecutions() != null ) { for ( java.util.Iterator i = getExecutions().iterator(); i.hasNext(); ) { PluginExecution exec = (PluginExecution) i.next(); if ( executionMap.containsKey( exec.getId() ) ) { throw new IllegalStateException( "You cannot have two plugin executions with the same (or missing) elements.\nOffending execution\n\nId: \'" + exec.getId() + "\'\nPlugin:\'" + getKey() + "\'\n\n" ); } executionMap.put( exec.getId(), exec ); } } } return executionMap; } /** * @return the key of the plugin, ie groupId:artifactId */ public String getKey() { return constructKey( groupId, artifactId ); } /** * @param groupId * @param artifactId * @return the key of the plugin, ie groupId:artifactId */ public static String constructKey( String groupId, String artifactId ) { return groupId + ":" + artifactId; } /** * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals( Object other ) { if ( other instanceof Plugin ) { Plugin otherPlugin = (Plugin) other; return getKey().equals( otherPlugin.getKey() ); } return false; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return getKey().hashCode(); } /** * @see java.lang.Object#toString() */ public String toString() { return "Plugin [" + getKey() + "]"; } ]]> PluginExecution 4.0.0 ConfigurationContainer <execution> element contains informations required for the execution of a plugin. ]]> id 4.0.0 true String default The identifier of this execution for labelling the goals during the build, and for matching exections to merge during inheritance. phase 4.0.0 String The build lifecycle phase to bind the goals in this execution to. If omitted, the goals will be bound to the default specified in their metadata. goals 4.0.0 The goals to execute with the given configuration. String * 4.0.0 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 used 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 their configuration. excludeDefaults 4.0.0 boolean If true, then the default reports are not included in the site generation. This includes the reports in the "Project Info" menu. false outputDirectory 4.0.0 String ${project.build.directory}/site . ]]> plugins 4.0.0 The reporting plugins to use and their configuration. ReportPlugin * 4.0.0 reportPluginMap field to null */ public void flushReportPluginMap() { this.reportPluginMap = null; } /** * @return a Map of plugins field with ReportPlugin#getKey() as key * @see org.apache.maven.model.ReportPlugin#getKey() */ public java.util.Map getReportPluginsAsMap() { if ( reportPluginMap == null ) { reportPluginMap = new java.util.HashMap(); if ( getPlugins() != null ) { for ( java.util.Iterator it = getPlugins().iterator(); it.hasNext(); ) { ReportPlugin reportPlugin = (ReportPlugin) it.next(); reportPluginMap.put( reportPlugin.getKey(), reportPlugin ); } } } return reportPluginMap; } ]]> Profile ModelBase 4.0.0 id true 4.0.0 String The identifier of this build profile. This used both for command line activation, and identifies identical profiles to merge with during inheritance. activation 4.0.0 Activation build 4.0.0 true BuildBase 4.0.0 Activation 4.0.0 activeByDefault 4.0.0 boolean Flag specifying whether this profile is active by default. jdk 4.0.0 String 1.4 only activates on JDKs versioned 1.4, while !1.4 matches any JDK that is not version 1.4. ]]> os 4.0.0 ActivationOS 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 required to activate a profile. ActivationOS 4.0.0 name 4.0.0 String ${os.name} Java property, such as Windows XP. ]]> family 4.0.0 String windows or unix. ]]> arch 4.0.0 String The architecture of the operating system to be used to activate the profile. version 4.0.0 String The version of the operating system to be used to activate the profile. ActivationFile 4.0.0 missing 4.0.0 String The name of the file that must be missing to activate the profile. exists 4.0.0 String The name of the file that must exist to activate the profile. ReportPlugin 4.0.0 <plugin> element contains informations required for a report plugin. ]]> groupId 4.0.0 String true org.apache.maven.plugins The group ID of the reporting plugin in the repository. artifactId 4.0.0 String true The artifact ID of the reporting plugin in the repository. version 4.0.0 String inherited 4.0.0 String Whether the configuration in this plugin should be made available to projects that inherit from this one. configuration 4.0.0 DOM The configuration of the reporting plugin. reportSets 4.0.0 execution in the build. ]]> ReportSet * 4.0.0 reportSetMap field to null */ public void flushReportSetMap() { this.reportSetMap = null; } /** * @return a Map of reportSets field with ReportSet#getId() as key * @see org.apache.maven.model.ReportSet#getId() */ public java.util.Map getReportSetsAsMap() { if ( reportSetMap == null ) { reportSetMap = new java.util.HashMap(); if ( getReportSets() != null ) { for ( java.util.Iterator i = getReportSets().iterator(); i.hasNext(); ) { ReportSet reportSet = (ReportSet) i.next(); reportSetMap.put( reportSet.getId(), reportSet ); } } } return reportSetMap; } /** * @return the key of the report plugin, ie groupId:artifactId */ public String getKey() { return constructKey( groupId, artifactId ); } /** * @param groupId * @param artifactId * @return the key of the report plugin, ie groupId:artifactId */ public static String constructKey( String groupId, String artifactId ) { return groupId + ":" + artifactId; } private boolean inheritanceApplied = true; public void unsetInheritanceApplied() { this.inheritanceApplied = false; } public boolean isInheritanceApplied() { return inheritanceApplied; } ]]> 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. default configuration 4.0.0 Configuration of the report to be used when generating this set. DOM inherited 4.0.0 String reports 4.0.0 true String * 4.0.0 Prerequisites 4.0.0 Describes the prerequisites a project can have. maven 4.0.0 String 2.0 The minimum version of Maven required to build the project, or to use this plugin. 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 ID 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 ID 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