[maven-release] branch MRELEASE-980 created (now 06fe6f7)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-release] branch MRELEASE-980 created (now 06fe6f7)

hboutemy
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to branch MRELEASE-980
in repository https://gitbox.apache.org/repos/asf/maven-release.git.


      at 06fe6f7  MRELEASE-980 Allow commit comments to be controlled

This branch includes the following new commits:

     new 06fe6f7  MRELEASE-980 Allow commit comments to be controlled

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Reply | Threaded
Open this post in threaded view
|

[maven-release] 01/01: MRELEASE-980 Allow commit comments to be controlled

hboutemy
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MRELEASE-980
in repository https://gitbox.apache.org/repos/asf/maven-release.git

commit 06fe6f7b0bcdd3a3a5ebd96a3b85dc4f5e1d7c59
Author: Hervé Boutemy <[hidden email]>
AuthorDate: Sun Dec 1 13:15:58 2019 +0100

    MRELEASE-980 Allow commit comments to be controlled
---
 .../shared/release/config/ReleaseDescriptor.java   | 34 +++++++++-
 .../src/main/components-fragment.xml               |  8 +--
 .../config/PropertiesReleaseDescriptorStore.java   | 16 +++++
 .../release/config/ReleaseDescriptorBuilder.java   | 36 +++++++++++
 .../maven/shared/release/config/ReleaseUtils.java  | 16 +++++
 .../release/phase/AbstractScmCommitPhase.java      | 48 ++++++++++++--
 .../release/phase/ScmCommitDevelopmentPhase.java   |  4 +-
 .../release/phase/ScmCommitPreparationPhase.java   | 17 +----
 .../src/main/mdo/release-descriptor.mdo            | 56 +++++++++++++++++
 .../phase/ScmCommitDevelopmentPhaseTest.java       | 15 +++++
 .../phase/ScmCommitPreparationPhaseTest.java       | 73 ++++++++++++++++++++++
 .../maven/plugins/release/BranchReleaseMojo.java   | 20 ++++++
 .../maven/plugins/release/PrepareReleaseMojo.java  | 42 +++++++++++++
 .../maven/plugins/release/RollbackReleaseMojo.java | 29 ++++++++-
 14 files changed, 383 insertions(+), 31 deletions(-)

diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java
index 52aecd1..a6d03c2 100644
--- a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java
+++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java
@@ -275,6 +275,38 @@ public interface ReleaseDescriptor
     String getScmCommentPrefix();
 
     /**
+     * Get the SCM commit comment when setting pom.xml to release.
+     *
+     * @return String
+     * @since 3.0.0-M1
+     */
+    String getScmReleaseCommitComment();
+
+    /**
+     * Get the SCM commit comment when setting pom.xml back to development.
+     *
+     * @return String
+     * @since 3.0.0-M1
+     */
+    String getScmDevelopmentCommitComment();
+
+    /**
+     * Get the SCM commit comment when branching.
+     *
+     * @return String
+     * @since 3.0.0-M1
+     */
+    String getScmBranchCommitComment();
+
+    /**
+     * Get the SCM commit comment when rolling back.
+     *
+     * @return String
+     * @since 3.0.0-M1
+     */
+    String getScmRollbackCommitComment();
+
+    /**
      * Get pass phrase for the private key.
      *
      * @return String
@@ -432,6 +464,4 @@ public interface ReleaseDescriptor
     void setScmRelativePathProjectDirectory( String scmRelativePathProjectDirectory );
 
     void setScmSourceUrl( String scmUrl );
-
-
 }
diff --git a/maven-release-manager/src/main/components-fragment.xml b/maven-release-manager/src/main/components-fragment.xml
index d6a0f60..6bb0f31 100644
--- a/maven-release-manager/src/main/components-fragment.xml
+++ b/maven-release-manager/src/main/components-fragment.xml
@@ -143,7 +143,7 @@
         </requirement>
       </requirements>
       <configuration>
-        <messageFormat>prepare release {0}</messageFormat>
+        <descriptorCommentGetter>getScmReleaseCommitComment</descriptorCommentGetter>
       </configuration>
     </component>
     <component>
@@ -156,7 +156,7 @@
         </requirement>
       </requirements>
       <configuration>
-        <messageFormat>prepare for next development iteration</messageFormat>
+        <descriptorCommentGetter>getScmDevelopmentCommitComment</descriptorCommentGetter>
         <rollbackMessageFormat>rollback changes from release preparation of {0}</rollbackMessageFormat>
       </configuration>
     </component>
@@ -170,7 +170,7 @@
         </requirement>
       </requirements>
       <configuration>
-        <messageFormat>prepare branch {0}</messageFormat>
+        <descriptorCommentGetter>getScmBranchCommitComment</descriptorCommentGetter>
       </configuration>
     </component>
     <component>
@@ -183,7 +183,7 @@
         </requirement>
       </requirements>
       <configuration>
-        <messageFormat>rollback the release of {0}</messageFormat>
+        <descriptorCommentGetter>getScmRollbackCommitComment</descriptorCommentGetter>
       </configuration>
     </component>
     <component>
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
index 9841e70..262b21d 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
@@ -194,6 +194,22 @@ public class PropertiesReleaseDescriptorStore
         {
             properties.setProperty( "scm.commentPrefix", config.getScmCommentPrefix() );
         }
+        if ( config.getScmDevelopmentCommitComment() != null )
+        {
+            properties.setProperty( "scm.developmentCommitComment", config.getScmDevelopmentCommitComment() );
+        }
+        if ( config.getScmReleaseCommitComment() != null )
+        {
+            properties.setProperty( "scm.releaseCommitComment", config.getScmReleaseCommitComment() );
+        }
+        if ( config.getScmBranchCommitComment() != null )
+        {
+            properties.setProperty( "scm.branchCommitComment", config.getScmBranchCommitComment() );
+        }
+        if ( config.getScmRollbackCommitComment() != null )
+        {
+            properties.setProperty( "scm.rollbackCommitComment", config.getScmRollbackCommitComment() );
+        }
         if ( config.getAdditionalArguments() != null )
         {
             properties.setProperty( "exec.additionalArguments", config.getAdditionalArguments() );
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
index 68a6a8e..ab9ec55 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptorBuilder.java
@@ -236,6 +236,42 @@ public class ReleaseDescriptorBuilder
         return this;
     }
 
+    /**
+     * @since 3.0.0-M1
+     */
+    public ReleaseDescriptorBuilder setScmReleaseCommitComment( String scmReleaseCommitComment )
+    {
+        releaseDescriptor.setScmReleaseCommitComment( scmReleaseCommitComment );
+        return this;
+    }
+
+    /**
+     * @since 3.0.0-M1
+     */
+    public ReleaseDescriptorBuilder setScmDevelopmentCommitComment( String scmDevelopmentCommitComment )
+    {
+        releaseDescriptor.setScmReleaseCommitComment( scmDevelopmentCommitComment );
+        return this;
+    }
+
+    /**
+     * @since 3.0.0-M1
+     */
+    public ReleaseDescriptorBuilder setScmBranchCommitComment( String scmBranchCommitComment )
+    {
+        releaseDescriptor.setScmReleaseCommitComment( scmBranchCommitComment );
+        return this;
+    }
+
+    /**
+     * @since 3.0.0-M1
+     */
+    public ReleaseDescriptorBuilder setScmRollbackCommitComment( String scmRollbackCommitComment )
+    {
+        releaseDescriptor.setScmReleaseCommitComment( scmRollbackCommitComment );
+        return this;
+    }
+
     public ReleaseDescriptorBuilder setScmId( String scmId )
     {
         releaseDescriptor.setScmId( scmId );
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
index 9200ee2..bc48cc5 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
@@ -103,6 +103,22 @@ public class ReleaseUtils
         {
             builder.setScmCommentPrefix( properties.getProperty( "scm.commentPrefix" ) );
         }
+        if ( properties.containsKey( "scm.developmentCommitComment" ) )
+        {
+            builder.setScmDevelopmentCommitComment( properties.getProperty( "scm.developmentCommitComment" ) );
+        }
+        if ( properties.containsKey( "scm.releaseCommitComment" ) )
+        {
+            builder.setScmReleaseCommitComment( properties.getProperty( "scm.releaseCommitComment" ) );
+        }
+        if ( properties.containsKey( "scm.branchCommitComment" ) )
+        {
+            builder.setScmBranchCommitComment( properties.getProperty( "scm.branchCommitComment" ) );
+        }
+        if ( properties.containsKey( "scm.rollbackCommitComment" ) )
+        {
+            builder.setScmRollbackCommitComment( properties.getProperty( "scm.rollbackCommitComment" ) );
+        }
         if ( properties.containsKey( "exec.additionalArguments" ) )
         {
             builder.setAdditionalArguments( properties.getProperty( "exec.additionalArguments" ) );
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
index 3269da2..3ae72ac 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
@@ -39,7 +39,6 @@ import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator;
 import org.apache.maven.shared.release.util.ReleaseUtil;
 
 import java.io.File;
-import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -63,9 +62,9 @@ public abstract class AbstractScmCommitPhase
     protected ScmRepositoryConfigurator scmRepositoryConfigurator;
 
     /**
-     * The format for the commit message.
+     * The getter in the descriptor for the comment.
      */
-    protected String messageFormat;
+    protected String descriptorCommentGetter;
 
     @Override
     public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
@@ -190,10 +189,47 @@ public abstract class AbstractScmCommitPhase
         }
     }
 
-    protected String createMessage( ReleaseDescriptor releaseDescriptor )
+    protected String createMessage( List<MavenProject> reactorProjects,
+                                    ReleaseDescriptor releaseDescriptor )
+                                    throws ReleaseExecutionException
     {
-        return MessageFormat.format( releaseDescriptor.getScmCommentPrefix() + messageFormat,
-                                     new Object[]{releaseDescriptor.getScmReleaseLabel()} );
+        String comment;
+        boolean branch = false;
+        if ( "getScmReleaseCommitComment".equals( descriptorCommentGetter ) )
+        {
+            comment = releaseDescriptor.getScmReleaseCommitComment();
+        }
+        else if ( "getScmDevelopmentCommitComment".equals( descriptorCommentGetter ) )
+        {
+            comment = releaseDescriptor.getScmDevelopmentCommitComment();
+        }
+        else if ( "getScmBranchCommitComment".equals( descriptorCommentGetter ) )
+        {
+            comment = releaseDescriptor.getScmBranchCommitComment();
+            branch = true;
+        }
+        else if ( "getScmRollbackCommitComment".equals( descriptorCommentGetter ) )
+        {
+            comment = releaseDescriptor.getScmRollbackCommitComment();
+        }
+        else
+        {
+            throw new ReleaseExecutionException( "Invalid configuration in components-fragment.xml" );
+        }
+        
+        MavenProject project = ReleaseUtil.getRootProject( reactorProjects );
+        comment = comment.replace( "@{prefix}", releaseDescriptor.getScmCommentPrefix().trim() );
+        comment = comment.replace( "@{groupId}", project.getGroupId() );
+        comment = comment.replace( "@{artifactId}", project.getArtifactId() );
+        if ( branch )
+        {
+            comment = comment.replace( "@{branchName}", releaseDescriptor.getScmReleaseLabel() );
+        }
+        else
+        {
+            comment = comment.replace( "@{releaseLabel}", releaseDescriptor.getScmReleaseLabel() );
+        }
+        return comment;
     }
 
     protected static List<File> createPomFiles( ReleaseDescriptor releaseDescriptor, MavenProject project )
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhase.java
index 5e81186..c81889e 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhase.java
@@ -79,13 +79,13 @@ public class ScmCommitDevelopmentPhase
             else
             {
                 // a normal commit
-                message = createMessage( releaseDescriptor );
+                message = createMessage( reactorProjects, releaseDescriptor );
             }
             if ( simulating )
             {
                 Collection<File> pomFiles = createPomFiles( releaseDescriptor, reactorProjects );
                 logInfo( result,
-                         "Full run would be commit " + pomFiles.size() + " files with message: '" + message + "'" );
+                         "Full run would commit " + pomFiles.size() + " files with message: '" + message + "'" );
             }
             else
             {
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhase.java
index 2e8d776..1bee2fb 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhase.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhase.java
@@ -28,7 +28,6 @@ import org.apache.maven.shared.release.env.ReleaseEnvironment;
 import org.apache.maven.shared.release.scm.ReleaseScmCommandException;
 import org.apache.maven.shared.release.scm.ReleaseScmRepositoryException;
 
-import java.text.MessageFormat;
 import java.util.List;
 
 /**
@@ -40,12 +39,6 @@ public class ScmCommitPreparationPhase
     extends AbstractScmCommitPhase
 {
 
-    /**
-     * The format for the
-     */
-    private String rollbackMessageFormat;
-
-    @Override
     protected void runLogic( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
                              List<MavenProject> reactorProjects, ReleaseResult result, boolean simulating )
         throws ReleaseScmCommandException, ReleaseExecutionException, ReleaseScmRepositoryException
@@ -66,8 +59,7 @@ public class ScmCommitPreparationPhase
         // commit development versions required
         else
         {
-            String message = createMessage( releaseDescriptor );
-
+            String message = createMessage( reactorProjects, releaseDescriptor );
             if ( simulating )
             {
                 simulateCheckins( releaseDescriptor, reactorProjects, result, message );
@@ -79,13 +71,6 @@ public class ScmCommitPreparationPhase
         }
     }
 
-    private String createRollbackMessage( ReleaseDescriptor releaseDescriptor )
-    {
-        return MessageFormat.format( releaseDescriptor.getScmCommentPrefix() + rollbackMessageFormat,
-                                     new Object[]{releaseDescriptor.getScmReleaseLabel()} );
-    }
-
-    @Override
     protected void validateConfiguration( ReleaseDescriptor releaseDescriptor )
         throws ReleaseFailureException
     {
diff --git a/maven-release-manager/src/main/mdo/release-descriptor.mdo b/maven-release-manager/src/main/mdo/release-descriptor.mdo
index fe41833..b63c4b4 100644
--- a/maven-release-manager/src/main/mdo/release-descriptor.mdo
+++ b/maven-release-manager/src/main/mdo/release-descriptor.mdo
@@ -69,6 +69,42 @@
           </description>
         </field>
         <field>
+          <name>scmReleaseCommitComment</name>
+          <version>3.0.0+</version>
+          <type>String</type>
+          <defaultValue>@{prefix} prepare release @{releaseLabel}</defaultValue>
+          <description>
+            The SCM commit comment when setting pom.xml to release
+          </description>
+        </field>
+        <field>
+          <name>scmDevelopmentCommitComment</name>
+          <version>3.0.0+</version>
+          <type>String</type>
+          <defaultValue>@{prefix} prepare for next development iteration</defaultValue>
+          <description>
+            The SCM commit comment when setting pom.xml back to development
+          </description>
+        </field>
+        <field>
+          <name>scmBranchCommitComment</name>
+          <version>3.0.0+</version>
+          <type>String</type>
+          <defaultValue>@{prefix} prepare branch @{releaseLabel}</defaultValue>
+          <description>
+            The SCM commit comment when branching
+          </description>
+        </field>
+        <field>
+          <name>scmRollbackCommitComment</name>
+          <version>3.0.0+</version>
+          <type>String</type>
+          <defaultValue>@{prefix} rollback the release of @{releaseLabel}</defaultValue>
+          <description>
+            The SCM commit comment when rolling back
+          </description>
+        </field>
+        <field>
           <name>scmSourceUrl</name>
           <version>1.0.0+</version>
           <type>String</type>
@@ -829,6 +865,22 @@
         {
             return false;
         }
+        if ( !java.util.Objects.equals( scmDevelopmentCommitComment, that.getScmDevelopmentCommitComment() ) )
+        {
+            return false;
+        }
+        if ( !java.util.Objects.equals( scmReleaseCommitComment, that.getScmReleaseCommitComment() ) )
+        {
+            return false;
+        }
+        if ( !java.util.Objects.equals( scmBranchCommitComment, that.getScmBranchCommitComment() ) )
+        {
+            return false;
+        }
+        if ( !java.util.Objects.equals( scmRollbackCommitComment, that.getScmRollbackCommitComment() ) )
+        {
+            return false;
+        }
         if ( !java.util.Objects.equals( scmPrivateKeyPassPhrase, that.getScmPrivateKeyPassPhrase() ) )
         {
             return false;
@@ -962,6 +1014,10 @@
         result = 29 * result + java.util.Objects.hashCode( completionGoals );
         result = 29 * result + java.util.Objects.hashCode( pomFileName );
         result = 29 * result + java.util.Objects.hashCode( checkModificationExcludes );
+        result = 29 * result + java.util.Objects.hashCode( scmDevelopmentCommitComment );
+        result = 29 * result + java.util.Objects.hashCode( scmReleaseCommitComment );
+        result = 29 * result + java.util.Objects.hashCode( scmBranchCommitComment );
+        result = 29 * result + java.util.Objects.hashCode( scmRollbackCommitComment );
         result = 29 * result + java.util.Objects.hashCode( scmTagBase );
         result = 29 * result + java.util.Objects.hashCode( scmBranchBase );
         result = 29 * result + java.util.Objects.hashCode( scmUsername );
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
index 41c90f3..50ba849 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
@@ -120,6 +120,21 @@ public class ScmCommitDevelopmentPhaseTest
     }
 
     @Test
+    public void testCommitsNextVersionsAlternateMessage()
+        throws Exception
+    {
+        builder.setUpdateWorkingCopyVersions( true );
+        builder.setScmCommentPrefix("[release]");
+        builder.setScmDevelopmentCommitComment("@{prefix} Development of @{groupId}:@{artifactId}");
+
+        prepareCheckin( "[release] Development of groupId:artifactId" );
+
+        phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new DefaultReleaseEnvironment(), reactorProjects );
+
+        verifyCheckin( "[release] Development of groupId:artifactId" );
+    }
+
+    @Test
     public void testCommitsRollbackPrepare()
         throws Exception
     {
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
index 54c1860..863cdbd 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
@@ -129,6 +129,41 @@ public class ScmCommitPreparationPhaseTest
     }
 
     @Test
+    public void testCommitAlternateMessage()
+        throws Exception
+    {
+        // prepare
+        List<MavenProject> reactorProjects = createReactorProjects();
+        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        builder.setScmSourceUrl( "scm-url" );
+        builder.setScmCommentPrefix("[release]");
+        builder.setScmReleaseCommitComment("@{prefix} Release of @{groupId}:@{artifactId} @{releaseLabel}");
+        MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() );
+        builder.setScmReleaseLabel( "release-label" );
+
+        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), rootProject.getFile() );
+
+        ScmProvider scmProviderMock = mock( ScmProvider.class );
+        when( scmProviderMock.checkIn( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ),
+                                       isNull( ScmVersion.class ),
+                                       eq( "[release] Release of groupId:artifactId release-label" ) ) ).thenReturn( new CheckInScmResult( "...",
+                                                                                                     Collections.singletonList( new ScmFile( rootProject.getFile().getPath(),
+                                                                                                                                             ScmFileStatus.CHECKED_IN ) ) ) );
+
+        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
+        stub.setScmProvider( scmProviderMock );
+
+        // execute
+        phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new DefaultReleaseEnvironment(), reactorProjects );
+
+        // verify
+        verify( scmProviderMock ).checkIn( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ),
+                                           isNull( ScmVersion.class ), eq( "[release] Release of groupId:artifactId release-label" ) );
+        verifyNoMoreInteractions( scmProviderMock );
+    }
+
+    @Test
     public void testCommitMultiModule()
         throws Exception
     {
@@ -205,6 +240,44 @@ public class ScmCommitPreparationPhaseTest
     }
 
     @Test
+    public void testCommitDevelopmentAlternateMessage()
+        throws Exception
+    {
+        // prepare
+        phase = (ReleasePhase) lookup( ReleasePhase.class, "scm-commit-development" );
+
+        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        List<MavenProject> reactorProjects = createReactorProjects();
+        builder.setScmSourceUrl( "scm-url" );
+        builder.setScmCommentPrefix("[release]");
+        builder.setScmDevelopmentCommitComment("@{prefix} Bump version of @{groupId}:@{artifactId} after @{releaseLabel}");
+        MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() );
+        builder.setScmReleaseLabel( "release-label" );
+
+        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), rootProject.getFile() );
+
+        ScmProvider scmProviderMock = mock( ScmProvider.class );
+        when( scmProviderMock.checkIn( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ),
+                                       isNull( ScmVersion.class ),
+                                       eq( "[release] Bump version of groupId:artifactId after release-label" ) ) ).thenReturn( new CheckInScmResult( "...",
+                                                                                                                                                    Collections.singletonList( new ScmFile( rootProject.getFile().getPath(),
+                                                                                                                                                                                            ScmFileStatus.CHECKED_IN ) ) ) );
+
+        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
+        stub.setScmProvider( scmProviderMock );
+
+        // execute
+        phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new DefaultReleaseEnvironment(), reactorProjects );
+
+        // verify
+        verify( scmProviderMock ).checkIn( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ),
+                                           isNull( ScmVersion.class ),
+                                           eq( "[release] Bump version of groupId:artifactId after release-label" ) );
+        verifyNoMoreInteractions( scmProviderMock );
+    }
+
+    @Test
     public void testCommitNoReleaseLabel()
         throws Exception
     {
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
index 029f6a0..1cbd467 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
@@ -211,6 +211,25 @@ public class BranchReleaseMojo
     @Parameter( property = "projectNamingPolicyId" )
     private String projectBranchNamingPolicyId;
 
+    /**
+     * The SCM commit comment when branching.
+     * Defaults to "@{prefix} prepare branch @{releaseLabel}".
+     * <p>
+     * Property interpolation is performed on the value, but in order to ensure that the interpolation occurs
+     * during release, you must use <code>@{...}</code> to reference the properties rather than <code>${...}</code>.
+     * The following properties are available:
+     * <ul>
+     *     <li><code>prefix</code> - The comment prefix.
+     *     <li><code>groupId</code> - The groupId of the root project.
+     *     <li><code>artifactId</code> - The artifactId of the root project.
+     *     <li><code>releaseLabel</code> - The release version of the root project.
+     * </ul>
+     *
+     * @since 3.0.0-M1
+     */
+    @Parameter( defaultValue = "@{prefix} prepare branch @{releaseLabel}", property = "scmBranchCommitComment" )
+    private String scmBranchCommitComment = "@{prefix} prepare branch @{releaseLabel}";
+
     @Override
     public void execute()
         throws MojoExecutionException, MojoFailureException
@@ -234,6 +253,7 @@ public class BranchReleaseMojo
         config.setSuppressCommitBeforeTagOrBranch( suppressCommitBeforeBranch );
         config.setProjectVersionPolicyId( projectVersionPolicyId );
         config.setProjectNamingPolicyId( projectBranchNamingPolicyId );
+        config.setScmBranchCommitComment( scmBranchCommitComment );
 
         if ( checkModificationExcludeList != null )
         {
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
index 0d9690f..1c3e057 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
@@ -240,6 +240,46 @@ public class PrepareReleaseMojo
     @Parameter( property = "projectNamingPolicyId" )
     private String projectTagNamingPolicyId;
 
+    /**
+     * The SCM commit comment when setting pom.xml to release.
+     * Defaults to "@{prefix} prepare release @{releaseLabel}".
+     * <p>
+     * Property interpolation is performed on the value, but in order to ensure that the interpolation occurs
+     * during release, you must use <code>@{...}</code> to reference the properties rather than <code>${...}</code>.
+     * The following properties are available:
+     * <ul>
+     *     <li><code>prefix</code> - The comment prefix.
+     *     <li><code>groupId</code> - The groupId of the root project.
+     *     <li><code>artifactId</code> - The artifactId of the root project.
+     *     <li><code>releaseLabel</code> - The release version of the root project.
+     * </ul>
+     *
+     * @since 3.0.0
+     */
+    @Parameter( defaultValue = "@{prefix} prepare release @{releaseLabel}", property = "scmReleaseCommitComment" )
+    private String scmReleaseCommitComment = "@{prefix} prepare release @{releaseLabel}";
+
+    /**
+     * The SCM commit comment when setting pom.xml back to development.
+     * Defaults to "@{prefix} prepare for next development iteration".
+     * <p>
+     * Property interpolation is performed on the value, but in order to ensure that the interpolation occurs
+     * during release, you must use <code>@{...}</code> to reference the properties rather than <code>${...}</code>.
+     * The following properties are available:
+     * <ul>
+     *     <li><code>prefix</code> - The comment prefix.
+     *     <li><code>groupId</code> - The groupId of the root project.
+     *     <li><code>artifactId</code> - The artifactId of the root project.
+     *     <li><code>releaseLabel</code> - The release version of the root project.
+     * </ul>
+     *
+     * @since 3.0.0
+     */
+    @Parameter(
+            defaultValue = "@{prefix} prepare for next development iteration",
+            property = "scmDevelopmentCommitComment" )
+    private String scmDevelopmentCommitComment = "@{prefix} prepare for next development iteration";
+
     @Override
     public void execute()
         throws MojoExecutionException, MojoFailureException
@@ -279,6 +319,8 @@ public class PrepareReleaseMojo
         config.setWaitBeforeTagging( waitBeforeTagging );
         config.setProjectVersionPolicyId( projectVersionPolicyId );
         config.setProjectNamingPolicyId( projectTagNamingPolicyId );
+        config.setScmDevelopmentCommitComment( scmDevelopmentCommitComment );
+        config.setScmReleaseCommitComment( scmReleaseCommitComment );
 
         if ( checkModificationExcludeList != null )
         {
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
index 4d2fcf5..11778c6 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
@@ -22,10 +22,12 @@ package org.apache.maven.plugins.release;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.shared.release.DefaultReleaseManagerListener;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseFailureException;
 import org.apache.maven.shared.release.ReleaseRollbackRequest;
+import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
 
 /**
  * Rollback changes made by a previous release. This requires that the previous release descriptor
@@ -41,16 +43,41 @@ import org.apache.maven.shared.release.ReleaseRollbackRequest;
 public class RollbackReleaseMojo
     extends AbstractScmReleaseMojo
 {
+
+    /**
+     * The SCM commit comment when rolling back.
+     * Defaults to "@{prefix} rollback the release of @{releaseLabel}".
+     * <p>
+     * Property interpolation is performed on the value, but in order to ensure that the interpolation occurs
+     * during release, you must use <code>@{...}</code> to reference the properties rather than <code>${...}</code>.
+     * The following properties are available:
+     * <ul>
+     *     <li><code>prefix</code> - The comment prefix.
+     *     <li><code>groupId</code> - The groupId of the root project.
+     *     <li><code>artifactId</code> - The artifactId of the root project.
+     *     <li><code>releaseLabel</code> - The release version of the root project.
+     * </ul>
+     *
+     * @since 3.0.0
+     */
+    @Parameter(
+            defaultValue = "@{prefix} rollback the release of @{releaseLabel}",
+            property = "scmRollbackCommitComment" )
+    private String scmRollbackCommitComment = "@{prefix} rollback the release of @{releaseLabel}";
+
     @Override
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
         super.execute();
 
+        final ReleaseDescriptorBuilder config = createReleaseDescriptor();
+        config.setScmRollbackCommitComment( scmRollbackCommitComment );
+
         try
         {
             ReleaseRollbackRequest rollbackRequest = new ReleaseRollbackRequest();
-            rollbackRequest.setReleaseDescriptorBuilder( createReleaseDescriptor() );
+            rollbackRequest.setReleaseDescriptorBuilder( config );
             rollbackRequest.setReleaseEnvironment( getReleaseEnvironment() );
             rollbackRequest.setReactorProjects( getReactorProjects()  );
             rollbackRequest.setReleaseManagerListener( new DefaultReleaseManagerListener( getLog() ) );