Releasing a project requires a lot of repetitive tasks. The objective of the Maven release
plugin is to automate them. The release
plugin defines the following eight goals, which are executed in two stages, preparing the release and performing the release:
release:clean
: This goal cleans up after a release preparationrelease:prepare
: This goal prepares for a release in Software Configuration Management (SCM)release:prepare-with-pom
: This goal prepares for a release in SCM and generates release POMs by fully resolving the dependenciesrelease:rollback
: This goal rolls back to a previous releaserelease:perform
: This goal performs a release from SCMrelease:stage
: This goal performs a release from SCM into a staging folder/repositoryrelease:branch
: This goal creates a branch of the current project with all versions updatedrelease:update-versions
: This goal updates versions in the POM(s)The preparation stage will complete the following tasks with the release:prepare
goal:
Finally, the release will be performed with the release:perform
goal. This will check the code from the release tag in the SCM and run a set of predefined goals: site, deploy-site
.
The maven-release-plugin
is not defined in the super POM and should be explicitly defined in your project POM file. The releaseProfiles
configuration element defines the profiles to be released and the goals
configuration element defines the plugin goals to be executed during the release:perform
goal. In the following configuration, the deploy
goal of the maven-deploy-plugin
and the single
goal of the maven-assembly-plugin
will get executed:
<plugin> <artifactId>maven-release-plugin</artifactId> <version>2.5</version> <configuration> <releaseProfiles>release</releaseProfiles> <goals>deploy assembly:single</goals> </configuration> </plugin>
More details about the Maven release plugin are available at http://maven.apache.org/maven-release/maven-release-plugin/.
3.140.197.136