Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRELEASE-1064] [REGRESSION] release:branch uses @releaseLabel instea… #221

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];
Expand All @@ -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 )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
return true
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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>.
Expand All @@ -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
Expand Down