You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Damien Diederen <dd...@sinenomine.net> on 2021/01/13 20:03:15 UTC

mvn release:branch and stray @{releaseLabel} (was: 3.7.0: Last call for tickets)

Hi Enrico,

> Il giorno dom 10 gen 2021 alle ore 22:13 Damien Diederen <
> ddiederen@sinenomine.net> ha scritto:
>>
>> Hi Enrico, all,
>>
>> Following the instructions in "Create a branch (when you create X.Y.0
>> and move master to X.Y+1.0)" in Confluence,¹ I noticed that:
>>
>>  1. The 'mvn release:branch' command does not seem to fully interpolate
>>     commit messages; I get:
>>
>>         [maven-release-plugin] prepare branch @{releaseLabel}
>
> This is strange, which version of Maven are you using? I suggest to use
> 3.6.3

It is.

I have been using the Docker environment, and just double-checked: it is
Maven 3.6.3, as expected:

    $ mvn --version
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /usr/share/maven
    Java version: 1.8.0_275, vendor: Oracle Corporation, runtime: /usr/local/openjdk-8/jre
    Default locale: en, platform encoding: UTF-8
    OS name: "linux", version: "5.4.0-42-generic", arch: "amd64", family: "unix"

I am seeing the same results with Maven outside of Docker…

… and looking at this code, I cannot say I am surprised:

    https://github.com/apache/maven-release/blob/761ab3b03cc3/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java#L224-L231

It seems that the token which gets replaced for branches is
'@{branchName}'.  And indeed, this produces the expected result:

    mvn release:branch \
        -DbranchName=$BRANCH_NAME \
        -DdevelopmentVersion=$MASTER_DEVELOPMENT_VERSION \
        -DscmBranchCommitComment='@{prefix} prepare branch @{branchName}' \
        -Pfull-build

I may be missing something, but it looks like the template is wrong:

    https://github.com/apache/maven-release/blob/761ab3b03cc3/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java#L230-L231

This partial revert of ZOOKEEPER-3791 "fixes" it:

    --- a/pom.xml
    +++ b/pom.xml
    @@ -694,6 +694,7 @@
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-release-plugin</artifactId>
    +          <version>2.5.3</version>
             </plugin>

Hmm…  I suppose I'll create a ticket for reverting that specific
version, and ask upstream what is going on.

>>  2. Tags are named via "release-$RELEASE_VERSION-$RC_NUM", instead of
>>     "...-rc$RC_NUM" for 3.5+.  Is that on purpose?
>
> yes it is, already pointed out by someone, but not an issue from my point
> of view
> good catch

Okay.  Was just wondering :)

Cheers, -D