Package org.apache.maven.plugins.release
Class PrepareReleaseMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.release.AbstractReleaseMojo
org.apache.maven.plugins.release.AbstractScmReleaseMojo
org.apache.maven.plugins.release.PrepareReleaseMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
PrepareWithPomReleaseMojo
@Mojo(name="prepare",
aggregator=true,
requiresDependencyCollection=TEST)
public class PrepareReleaseMojo
extends AbstractScmReleaseMojo
Prepare for a release in SCM. Steps through several phases to ensure the POM is ready to be released and then
prepares SCM to eventually contain a tagged version of the release and a record in the local copy of the parameters
used. This can be followed by a call to release:perform. For more info see https://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html.
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether to add a schema to the POM if it was previously missing on release.private booleanWhether to allow usage of a SNAPSHOT version of the Release Plugin.private booleanWhether to allow timestamped SNAPSHOT dependencies.private booleanWhether to automatically assign submodules the parent version.private StringCommand-line version of checkModificationExcludes.private String[]A list of additional exclude filters that will be skipped when checking for modifications on the working copy.private booleanCommits to do are atomic or by project.private StringGoals to run on completion of the preparation step, after transformation back to the next development version but before committing.private StringDefault version to use for new local working copy.private booleanDry run: don't checkin or tag anything in the scm repository, or modify the checkout.private booleanDeprecated.Please use release:prepare-with-pom instead.private StringGoals to run as part of the preparation step, after transformation but before committing.private StringThe role-hint for theNamingPolicyimplementation used to calculate the project branch and tag names.private StringThe role-hint for theVersionPolicyimplementation used to calculate the project versions.private StringDefault version to use when preparing a release or a branch.private booleanCurrently only implemented with svn scm.private booleanResume a previous release attempt from the point where it was stopped.private StringThe SCM commit comment when setting pom.xml back to development.private StringThe SCM commit comment when setting pom.xml to release.private booleanWhether to suppress a commit of changes to the working copy before the tag is created.private booleanWhether to update dependencies version to the next development version.private booleanWhether to bump the working copy versions todevelopmentVersion.private booleanWhether to use "edit" mode on the SCM, to lock the file for editing during SCM operations.private intWait the specified number of seconds before creating the tag.Fields inherited from class org.apache.maven.plugins.release.AbstractReleaseMojo
project, releaseManager, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected voidprepareRelease(boolean generateReleasePoms) Methods inherited from class org.apache.maven.plugins.release.AbstractScmReleaseMojo
buildScm, createReleaseDescriptorMethods inherited from class org.apache.maven.plugins.release.AbstractReleaseMojo
addArgument, getAdditionalProfiles, getBasedir, getCommonBasedir, getReactorProjects, getReleaseEnvironment, getSettings, setBasedir, setPomFileName, setReleaseManagerMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
resume
@Parameter(defaultValue="true", property="resume") private boolean resumeResume a previous release attempt from the point where it was stopped. -
generateReleasePoms
@Deprecated @Parameter(defaultValue="false", property="generateReleasePoms") private boolean generateReleasePomsDeprecated.Please use release:prepare-with-pom instead. -
useEditMode
@Parameter(defaultValue="false", property="useEditMode") private boolean useEditModeWhether to use "edit" mode on the SCM, to lock the file for editing during SCM operations. -
updateDependencies
@Parameter(defaultValue="true", property="updateDependencies") private boolean updateDependenciesWhether to update dependencies version to the next development version.- Since:
- 2.0-beta-5
-
autoVersionSubmodules
@Parameter(defaultValue="false", property="autoVersionSubmodules") private boolean autoVersionSubmodulesWhether to automatically assign submodules the parent version. If set to false, the user will be prompted for the version of each submodules.- Since:
- 2.0-beta-5
-
dryRun
@Parameter(defaultValue="false", property="dryRun") private boolean dryRunDry run: don't checkin or tag anything in the scm repository, or modify the checkout. Runningmvn -DdryRun=true release:prepareis useful in order to check that modifications to poms and scm operations (only listed on the console) are working as expected. Modified POMs are written alongside the originals without modifying them. -
addSchema
@Parameter(defaultValue="true", property="addSchema") private boolean addSchemaWhether to add a schema to the POM if it was previously missing on release. -
preparationGoals
@Parameter(defaultValue="clean verify", property="preparationGoals") private String preparationGoalsGoals to run as part of the preparation step, after transformation but before committing. Space delimited. -
completionGoals
Goals to run on completion of the preparation step, after transformation back to the next development version but before committing. Space delimited.- Since:
- 2.2
-
commitByProject
@Parameter(defaultValue="false", property="commitByProject") private boolean commitByProjectCommits to do are atomic or by project.- Since:
- 2.0-beta-5
-
allowTimestampedSnapshots
@Parameter(defaultValue="false", property="ignoreSnapshots") private boolean allowTimestampedSnapshotsWhether to allow timestamped SNAPSHOT dependencies. Default is to fail when finding any SNAPSHOT.- Since:
- 2.0-beta-7
-
allowReleasePluginSnapshot
@Parameter(defaultValue="false", property="allowReleasePluginSnapshot", readonly=true) private boolean allowReleasePluginSnapshotWhether to allow usage of a SNAPSHOT version of the Release Plugin. This in an internal property used to support testing of the plugin itself in batch mode.- Since:
- 2.0-beta-9
-
checkModificationExcludes
A list of additional exclude filters that will be skipped when checking for modifications on the working copy. Is ignored, when checkModificationExcludes is set.- Since:
- 2.1
-
checkModificationExcludeList
Command-line version of checkModificationExcludes.- Since:
- 2.1
-
releaseVersion
Default version to use when preparing a release or a branch.- Since:
- 2.0-beta-8
-
developmentVersion
Default version to use for new local working copy.- Since:
- 2.0-beta-8
-
remoteTagging
@Parameter(defaultValue="true", property="remoteTagging") private boolean remoteTaggingCurrently only implemented with svn scm.- Enables a workaround to prevent issue due to svn client > 1.5.0 (fixed in 1.6.5) (https://issues.apache.org/jira/browse/SCM-406)
- You may not want to use this in conjunction with
suppressCommitBeforeTag, such that no poms with released versions are committed to the working copy ever.
- Since:
- 2.0-beta-9
-
updateWorkingCopyVersions
@Parameter(defaultValue="true", property="updateWorkingCopyVersions") private boolean updateWorkingCopyVersionsWhether to bump the working copy versions todevelopmentVersion.- Since:
- 2.1
-
suppressCommitBeforeTag
@Parameter(defaultValue="false", property="suppressCommitBeforeTag") private boolean suppressCommitBeforeTagWhether to suppress a commit of changes to the working copy before the tag is created.
This requiresremoteTaggingto be set to false.
suppressCommitBeforeTagis useful when you want to avoid poms with released versions in all revisions of your trunk or development branch.- Since:
- 2.1
-
waitBeforeTagging
@Parameter(defaultValue="0", property="waitBeforeTagging") private int waitBeforeTaggingWait the specified number of seconds before creating the tag.
waitBeforeTaggingis useful when your source repository is synced between several instances and access to it is determined by geographical location, like the SVN repository at the Apache Software Foundation.- Since:
- 2.2
-
projectVersionPolicyId
@Parameter(defaultValue="default", property="projectVersionPolicyId") private String projectVersionPolicyIdThe role-hint for theVersionPolicyimplementation used to calculate the project versions.- Since:
- 2.5.1
- See Also:
-
projectTagNamingPolicyId
The role-hint for theNamingPolicyimplementation used to calculate the project branch and tag names.- Since:
- 3.0.0
- See Also:
-
scmReleaseCommitComment
@Parameter(defaultValue="@{prefix} prepare release @{releaseLabel}", property="scmReleaseCommitComment") private String scmReleaseCommitCommentThe SCM commit comment when setting pom.xml to release. Defaults to "@{prefix} prepare release @{releaseLabel}".Property interpolation is performed on the value, but in order to ensure that the interpolation occurs during release, you must use
@{...}to reference the properties rather than${...}. The following properties are available:prefix- The comment prefix.groupId- The groupId of the root project.artifactId- The artifactId of the root project.releaseLabel- The release version of the root project.
- Since:
- 3.0.0
-
scmDevelopmentCommitComment
@Parameter(defaultValue="@{prefix} prepare for next development iteration", property="scmDevelopmentCommitComment") private String scmDevelopmentCommitCommentThe SCM commit comment when setting pom.xml back to development. Defaults to "@{prefix} prepare for next development iteration".Property interpolation is performed on the value, but in order to ensure that the interpolation occurs during release, you must use
@{...}to reference the properties rather than${...}. The following properties are available:prefix- The comment prefix.groupId- The groupId of the root project.artifactId- The artifactId of the root project.releaseLabel- The release version of the root project.
- Since:
- 3.0.0
-
-
Constructor Details
-
PrepareReleaseMojo
public PrepareReleaseMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Overrides:
executein classAbstractScmReleaseMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
prepareRelease
protected void prepareRelease(boolean generateReleasePoms) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-