maven Maven 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 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 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 maven site. All of the reports will be included in the navigation bar for browsing in the order they are specified. ]]> Reports dependencyManagement 4.0.0 false DependencyManagement distributionManagement 4.0.0 DistributionManagement
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 * 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 directory 4.0.0 String outputDirectory 4.0.0 String testOutputDirectory 4.0.0 String 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 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
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 The scope of the dependency - compile, runtime, test. Used to calculate the various classpaths used for testing, etc. and for determining which artifacts to include in a distribution of this project. String compile
3.0.0+ 4.0.0 3.0.0 element is explicity used in the POM. if ( getJar() != null) { return getJar(); } return getArtifactId() + "-" + getVersion() + "." + getExtension(); } public String getExtension() { if ("ejb".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()) || "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 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 Repository site 4.0.0 Site downloadUrl 4.0.0+ url. ]]> 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 String groupId 4.0.0 String version 4.0.0 String 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 Repository 4.0.0 id 4.0.0 String name 4.0.0 String url 4.0.0 String snapshotPolicy 4.0.0 The policy for downloading snapshots - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never". String daily 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 Site 4.0.0 id 4.0.0 String name 4.0.0 String url 4.0.0 String Plugin 4.0.0 groupId 4.0.0 String org.apache.maven.plugins artifactId 4.0.0 String true version 4.0.0 true String inherited 4.0.0 String configuration DOM goals 4.0.0 Goal * 4.0.0 Goal 4.0.0 id 4.0.0 String inherited 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. Reports 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 reporting plugins to use and their configuration Plugin * 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 String