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 AbstractScmReleaseMojoPrepare 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
Fields Modifier and Type Field Description private booleanaddSchemaWhether to add a schema to the POM if it was previously missing on release.private booleanallowReleasePluginSnapshotWhether to allow usage of a SNAPSHOT version of the Release Plugin.private booleanallowTimestampedSnapshotsWhether to allow timestamped SNAPSHOT dependencies.private booleanautoVersionSubmodulesWhether to automatically assign submodules the parent version.private java.lang.StringcheckModificationExcludeListCommand-line version of checkModificationExcludes.private java.lang.String[]checkModificationExcludesA list of additional exclude filters that will be skipped when checking for modifications on the working copy.private booleancommitByProjectCommits to do are atomic or by project.private java.lang.StringcompletionGoalsGoals to run on completion of the preparation step, after transformation back to the next development version but before committing.private java.lang.StringdevelopmentVersionDefault version to use for new local working copy.private booleandryRunDry run: don't checkin or tag anything in the scm repository, or modify the checkout.private booleangenerateReleasePomsDeprecated.Please use release:prepare-with-pom instead.private java.lang.StringpreparationGoalsGoals to run as part of the preparation step, after transformation but before committing.private java.lang.StringprojectTagNamingPolicyIdThe role-hint for theNamingPolicyimplementation used to calculate the project branch and tag names.private java.lang.StringprojectVersionPolicyIdThe role-hint for theVersionPolicyimplementation used to calculate the project versions.private java.lang.StringreleaseVersionDefault version to use when preparing a release or a branch.private booleanremoteTaggingCurrently only implemented with svn scm.private booleanresumeResume a previous release attempt from the point where it was stopped.private java.lang.StringscmDevelopmentCommitCommentThe SCM commit comment when setting pom.xml back to development.private java.lang.StringscmReleaseCommitCommentThe SCM commit comment when setting pom.xml to release.private booleansuppressCommitBeforeTagWhether to suppress a commit of changes to the working copy before the tag is created.private booleanupdateDependenciesWhether to update dependencies version to the next development version.private booleanupdateWorkingCopyVersionsWhether to bump the working copy versions todevelopmentVersion.private booleanuseEditModeWhether to use "edit" mode on the SCM, to lock the file for editing during SCM operations.private intwaitBeforeTaggingWait the specified number of seconds before creating the tag.-
Fields inherited from class org.apache.maven.plugins.release.AbstractReleaseMojo
project, releaseManager, session
-
-
Constructor Summary
Constructors Constructor Description PrepareReleaseMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()protected voidprepareRelease(boolean generateReleasePoms)-
Methods inherited from class org.apache.maven.plugins.release.AbstractScmReleaseMojo
buildScm, createReleaseDescriptor
-
Methods inherited from class org.apache.maven.plugins.release.AbstractReleaseMojo
addArgument, getAdditionalProfiles, getBasedir, getCommonBasedir, getReactorProjects, getReleaseEnvironment, getSettings, setBasedir, setPomFileName, setReleaseManager
-
-
-
-
Field Detail
-
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 java.lang.String preparationGoalsGoals to run as part of the preparation step, after transformation but before committing. Space delimited.
-
completionGoals
@Parameter(defaultValue="", property="completionGoals") private java.lang.String completionGoalsGoals 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
@Parameter private java.lang.String[] 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
@Parameter(property="checkModificationExcludeList") private java.lang.String checkModificationExcludeList
Command-line version of checkModificationExcludes.- Since:
- 2.1
-
releaseVersion
@Parameter(property="releaseVersion") private java.lang.String releaseVersion
Default version to use when preparing a release or a branch.- Since:
- 2.0-beta-8
-
developmentVersion
@Parameter(property="developmentVersion") private java.lang.String 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 java.lang.String projectVersionPolicyIdThe role-hint for theVersionPolicyimplementation used to calculate the project versions.- Since:
- 2.5.1
- See Also:
DefaultVersionPolicy
-
projectTagNamingPolicyId
@Parameter(property="projectNamingPolicyId") private java.lang.String projectTagNamingPolicyId
The role-hint for theNamingPolicyimplementation used to calculate the project branch and tag names.- Since:
- 3.0.0
- See Also:
DefaultNamingPolicy
-
scmReleaseCommitComment
@Parameter(defaultValue="@{prefix} prepare release @{releaseLabel}", property="scmReleaseCommitComment") private java.lang.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 java.lang.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
-
-
Method Detail
-
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
-
-