Skip to content

Commit f3bbb77

Browse files
committed
[MRELEASE-1064] [REGRESSION] release:branch uses @releaseLabel instead of @branchName in default SCM commit
This closes #221
1 parent fa6c3db commit f3bbb77

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.groovy

+12-9
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* to you under the Apache License, Version 2.0 (the
77
* "License"); you may not use this file except in compliance
88
* with the License. You may obtain a copy of the License at
9-
*
9+
*
1010
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
11+
*
1212
* Unless required by applicable law or agreed to in writing,
1313
* software distributed under the License is distributed on an
1414
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,12 +17,15 @@
1717
* under the License.
1818
*/
1919

20+
File buildLog = new File( basedir, 'build.log' )
21+
assert buildLog.exists()
22+
23+
assert buildLog.getText().contains("[INFO] Full run would be commit 1 files with message: '[maven-release-plugin] prepare branch test-1.0.x'")
24+
2025
try
21-
{
22-
File buildLog = new File( basedir, "build.log" );
23-
26+
{
2427
System.out.println( "Checking logs..." );
25-
28+
2629
StringBuffer data = new StringBuffer( 1024 );
2730
BufferedReader reader = new BufferedReader( new FileReader( buildLog ) );
2831
char[] buf = new char[1024];
@@ -37,13 +40,13 @@ try
3740
String contents = data.toString();
3841

3942
String one_expected = "Checking in modified POMs";
40-
43+
4144
int pos = contents.indexOf( one_expected );
42-
45+
4346
if( contents.indexOf( one_expected, pos ) == -1 )
4447
{
4548
return true;
46-
}
49+
}
4750
}
4851
catch( Throwable t )
4952
{

maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@
2020

2121
import groovy.xml.XmlSlurper
2222

23+
File buildLog = new File( basedir, 'build.log' )
24+
assert buildLog.exists()
25+
26+
assert buildLog.getText().contains("[INFO] Full run would be commit 1 files with message: '[maven-release-plugin] prepare branch RELEASE-2.6.0'")
27+
2328
def projectBranch = new XmlSlurper().parse( new File( basedir, "pom.xml.branch" ) )
2429
assert projectBranch.version.text() == "2.6.0-BRANCH-SNAPSHOT"
2530

2631
def projectNext = new XmlSlurper().parse( new File( basedir, "pom.xml.next" ) )
2732
assert projectNext.version.text() == "2.6.1-DEV-SNAPSHOT"
2833

29-
return true
34+
return true

maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy

+5
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ assert project.version.text() == "1.0-SNAPSHOT"
2727
def projectNext = new XmlSlurper().parse( new File( basedir, "pom.xml.next" ) )
2828
assert projectNext.version.text() == "1.0-SNAPSHOT"
2929

30+
File buildLog = new File( basedir, 'build.log' )
31+
assert buildLog.exists()
32+
33+
assert buildLog.getText().contains("[INFO] Full run would be commit 1 files with message: '[maven-release-plugin] prepare branch branch-mrelease-976'")
34+
3035
return true

maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public class BranchReleaseMojo extends AbstractScmReleaseMojo {
218218

219219
/**
220220
* The SCM commit comment when branching.
221-
* Defaults to "@{prefix} prepare branch @{releaseLabel}".
221+
* Defaults to "@{prefix} prepare branch @{branchName}".
222222
* <p>
223223
* Property interpolation is performed on the value, but in order to ensure that the interpolation occurs
224224
* during release, you must use <code>@{...}</code> to reference the properties rather than <code>${...}</code>.
@@ -227,13 +227,13 @@ public class BranchReleaseMojo extends AbstractScmReleaseMojo {
227227
* <li><code>prefix</code> - The comment prefix.
228228
* <li><code>groupId</code> - The groupId of the root project.
229229
* <li><code>artifactId</code> - The artifactId of the root project.
230-
* <li><code>releaseLabel</code> - The release version of the root project.
230+
* <li><code>branchName</code> - The branch name of the root project.
231231
* </ul>
232232
*
233233
* @since 3.0.0-M1
234234
*/
235-
@Parameter(defaultValue = "@{prefix} prepare branch @{releaseLabel}", property = "scmBranchCommitComment")
236-
private String scmBranchCommitComment = "@{prefix} prepare branch @{releaseLabel}";
235+
@Parameter(defaultValue = "@{prefix} prepare branch @{branchName}", property = "scmBranchCommitComment")
236+
private String scmBranchCommitComment = "@{prefix} prepare branch @{branchName}";
237237

238238
/**
239239
* Currently only implemented with svn scm. Enable the {@code --pin-externals} option in

0 commit comments

Comments
 (0)