Class 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 Detail

      • resume

        @Parameter(defaultValue="true",
                   property="resume")
        private boolean resume
        Resume a previous release attempt from the point where it was stopped.
      • generateReleasePoms

        @Deprecated
        @Parameter(defaultValue="false",
                   property="generateReleasePoms")
        private boolean generateReleasePoms
        Deprecated.
        Please use release:prepare-with-pom instead.
      • useEditMode

        @Parameter(defaultValue="false",
                   property="useEditMode")
        private boolean useEditMode
        Whether to use "edit" mode on the SCM, to lock the file for editing during SCM operations.
      • updateDependencies

        @Parameter(defaultValue="true",
                   property="updateDependencies")
        private boolean updateDependencies
        Whether to update dependencies version to the next development version.
        Since:
        2.0-beta-5
      • autoVersionSubmodules

        @Parameter(defaultValue="false",
                   property="autoVersionSubmodules")
        private boolean autoVersionSubmodules
        Whether 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 dryRun
        Dry run: don't checkin or tag anything in the scm repository, or modify the checkout. Running mvn -DdryRun=true release:prepare is 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 addSchema
        Whether 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 preparationGoals
        Goals to run as part of the preparation step, after transformation but before committing. Space delimited.
      • completionGoals

        @Parameter(defaultValue="",
                   property="completionGoals")
        private java.lang.String 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 commitByProject
        Commits to do are atomic or by project.
        Since:
        2.0-beta-5
      • allowTimestampedSnapshots

        @Parameter(defaultValue="false",
                   property="ignoreSnapshots")
        private boolean allowTimestampedSnapshots
        Whether 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 allowReleasePluginSnapshot
        Whether 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 remoteTagging
        Currently 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 updateWorkingCopyVersions
        Whether to bump the working copy versions to developmentVersion.
        Since:
        2.1
      • suppressCommitBeforeTag

        @Parameter(defaultValue="false",
                   property="suppressCommitBeforeTag")
        private boolean suppressCommitBeforeTag
        Whether to suppress a commit of changes to the working copy before the tag is created.

        This requires remoteTagging to be set to false.

        suppressCommitBeforeTag is 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 waitBeforeTagging
        Wait the specified number of seconds before creating the tag.
        waitBeforeTagging is 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 projectVersionPolicyId
        The role-hint for the VersionPolicy implementation 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 the NamingPolicy implementation 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 scmReleaseCommitComment
        The 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 scmDevelopmentCommitComment
        The 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 Detail

      • PrepareReleaseMojo

        public PrepareReleaseMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        Overrides:
        execute in class AbstractScmReleaseMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.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.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException