------ Prepare a Release ------ Carlos Sanchez Brett Porter John Tolentino Dennis Lundberg ------ 2010-01-03 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. Prepare a Release Preparing a release goes through the following release phases: * Check that there are no uncommitted changes in the sources * Check that there are no SNAPSHOT dependencies * Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use) * Transform the SCM information in the POM to include the final destination of the tag * Run the project tests against the modified POMs to confirm everything is in working order * Commit the modified POMs * Tag the code in the SCM with a version name (this will be prompted for) * Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for) * Commit the modified POMs [] To prepare a release execute this command: ------- mvn release:prepare ------- <> If an error occurs, or the process is cancelled, then running this command again will pick up from where the last one left off. If you wish to start again, use: ------- mvn release:prepare -Dresume=false ------- Alternatively, you can use: ------- mvn release:clean release:prepare ------- <> If any changes have been made to your source files they might need to be reverted before you restart the prepare process. You can use <<>> to make the plugin do it for you. * Multi-module projects You will be prompted for the version number for each module of the project. If you prefer that every module gets the same version as the parent POM, you can set the option <<>> to <<>>. Now you will be asked only once for the release version and the next development version. * Generating release POMs It is possible to generate a <<>> file for each project that contains the fully resolved project used at release time as a record for later. As of the 2.0 release, this requires calling an alternate goal: --- mvn release:prepare-with-pom --- This goal is equivalent to the <<>> goal, except that it requires a previous build of the project to exist to properly populate the <<>> files. * Overriding the default tag name format By default, if you do not specify a tag name, a default tag name of <<>>-<<>> will be suggested (and if running non-interactively used). You can specify the exact tag name to use from the command line by passing the <<>> property, but if you want to have the tag name generated, but just change the default pattern, you can use the <<>> configuration option. For example to have the tag name default to the version number prefixed with a <<>> you could configure your pom like so: +----- [...] [...] [...] org.apache.maven.plugins maven-release-plugin ${project.version} v@{project.version} [...] [...] [...] +----- The tagNameFormat uses <<<@\{>>> and <<<}>>> as delimiters in order to ensure that the default Maven property interpolation does not substitute the values before the version transformation has taken place. The following properties are supported: * <<>> which corresponds to the project's groupId. * <<>> which corresponds to the project's artifactId. * <<>> which corresponds to the project's release version. [] The <<>> prefix is optional and may be omitted.