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.

Working with Source Control

Working with your source control system in Maven is quite simple. Maven can provide the following services:

  • Common tasks such as checking out code, tagging the current code, and performing an update
  • Generating reports on the recent usage history of source control
  • Providing links to a web view of the source control, and if desired publishing that information to the project site

Support is provided by the Maven SCM subproject. This provides support for the following SCM systems:

  • CVS
  • Subversion
  • ClearCase (partial)
  • Perforce (partial)
  • StarTeam (partial)
  • Visual SourceSafe (planned)

Configuration is extremely simple - in most cases, you need only specify the <connection/> string in the <repository/> element of your POM. Specifics about this connection string can be found in the SCM plugin documentation.

Performing Common Tasks

It is possible to perform several common tasks with Maven. These can be particularly useful for automation in your development environment, or in continuous integration.

There are also goals that provide assistance with making releases from your SCM.

For more information about common tasks and SCM based releases, see the SCM Plugin Documentation. This contains a complete guide to the scm: goals and related properties.

For general information on making releases with Maven, please see Making Releases.

Generating Reports

Maven provides three different reports on SCM usage that can be included in your project site. These are provided by the Change Log, File Activity and Developer Activity plugins.

These are included in your project site by default, however if you would like to explicitly select them for your project, add any or all of the following lines to project.xml inside the <reports/> section:

<report>maven-changelog-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-developer-activity-plugin</report>

For examples of these reports, please see the ones published for this project: Change Log, File Activity, and Developer Activity.

There are other SCM reports available for Maven, such as the excellent StatCVS plugin. These are included on the 3rd Party Plugins list.

Adding SCM Information to Your Site

The source control information for the project is included by default in the project site. For example, see the SCM Usage page for this project.

For more information, please see Creating a Site.