You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2024/06/13 20:22:10 UTC
(maven-release) 01/01: [MRELEASE-1064] [REGRESSION] release:branch uses @releaseLabel instead of @branchName in default SCM commit
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch MRELEASE-1064
in repository https://gitbox.apache.org/repos/asf/maven-release.git
commit f3bbb7769da79cce175cf1e9b47a617e56195753
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu Jun 13 22:13:54 2024 +0200
[MRELEASE-1064] [REGRESSION] release:branch uses @releaseLabel instead of @branchName in default SCM commit
This closes #221
---
.../it/projects/branch/MRELEASE-458/verify.groovy | 21 ++++++++++++---------
.../it/projects/branch/MRELEASE-694/verify.groovy | 7 ++++++-
.../it/projects/branch/MRELEASE-976/verify.groovy | 5 +++++
.../maven/plugins/release/BranchReleaseMojo.java | 8 ++++----
4 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.groovy b/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.groovy
index 010e552f..9eb79ca0 100644
--- a/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.groovy
+++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.groovy
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,12 +17,15 @@
* under the License.
*/
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+
+assert buildLog.getText().contains("[INFO] Full run would be commit 1 files with message: '[maven-release-plugin] prepare branch test-1.0.x'")
+
try
-{
- File buildLog = new File( basedir, "build.log" );
-
+{
System.out.println( "Checking logs..." );
-
+
StringBuffer data = new StringBuffer( 1024 );
BufferedReader reader = new BufferedReader( new FileReader( buildLog ) );
char[] buf = new char[1024];
@@ -37,13 +40,13 @@ try
String contents = data.toString();
String one_expected = "Checking in modified POMs";
-
+
int pos = contents.indexOf( one_expected );
-
+
if( contents.indexOf( one_expected, pos ) == -1 )
{
return true;
- }
+ }
}
catch( Throwable t )
{
diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy b/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy
index 663166f1..3514168c 100644
--- a/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy
+++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy
@@ -20,10 +20,15 @@
import groovy.xml.XmlSlurper
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+
+assert buildLog.getText().contains("[INFO] Full run would be commit 1 files with message: '[maven-release-plugin] prepare branch RELEASE-2.6.0'")
+
def projectBranch = new XmlSlurper().parse( new File( basedir, "pom.xml.branch" ) )
assert projectBranch.version.text() == "2.6.0-BRANCH-SNAPSHOT"
def projectNext = new XmlSlurper().parse( new File( basedir, "pom.xml.next" ) )
assert projectNext.version.text() == "2.6.1-DEV-SNAPSHOT"
-return true
\ No newline at end of file
+return true
diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy b/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy
index b7de67c3..93aaa822 100644
--- a/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy
+++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy
@@ -27,4 +27,9 @@ assert project.version.text() == "1.0-SNAPSHOT"
def projectNext = new XmlSlurper().parse( new File( basedir, "pom.xml.next" ) )
assert projectNext.version.text() == "1.0-SNAPSHOT"
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+
+assert buildLog.getText().contains("[INFO] Full run would be commit 1 files with message: '[maven-release-plugin] prepare branch branch-mrelease-976'")
+
return true
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 db314c4b..f0eb8cc4 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
@@ -218,7 +218,7 @@ public class BranchReleaseMojo extends AbstractScmReleaseMojo {
/**
* The SCM commit comment when branching.
- * Defaults to "@{prefix} prepare branch @{releaseLabel}".
+ * Defaults to "@{prefix} prepare branch @{branchName}".
* <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>.
@@ -227,13 +227,13 @@ public class BranchReleaseMojo extends AbstractScmReleaseMojo {
* <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.
+ * <li><code>branchName</code> - The branch name 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}";
+ @Parameter(defaultValue = "@{prefix} prepare branch @{branchName}", property = "scmBranchCommitComment")
+ private String scmBranchCommitComment = "@{prefix} prepare branch @{branchName}";
/**
* Currently only implemented with svn scm. Enable the {@code --pin-externals} option in