'Maven release plugin scmReleaseCommitComment parameter
I am using maven release plugin for automated releases from Jenkins without any Jenkins-plugins. Release commit, tag and development commit are created in Git and released project is deployed to Nexus.
What I try to achieve is to change the release commit message. As of release plugin documentation there is an option scmReleaseCommitComment
, which is per default @{prefix} prepare release @{releaseLabel}
. Maven command look like following and all variables are non empty values.
mvn -f ${projectpath}pom.xml release:clean release:prepare release:perform -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOPMENT_VERSION}-SNAPSHOT -Dtag=v${RELEASE_VERSION} -DscmReleaseCommitComment=${RELEASE_COMMENT}
Adding scmReleaseCommitComment
does no effect and commits are still done with default message. What am I missing here?
Solution 1:[1]
That feature was introduced in version 3.0.0-M1 of the maven-release-plugin. You can set it to the latest version in the <plugins>
section of your pom.xml, as in the example bellow:
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
[...]
</plugins>
Not that you can set the scmReleaseCommitComment
in the command line as you showed in your question, using mvn ... release:perform ...-DscmReleaseCommitComment=${MY_RELEASE_COMMENT}
, or you can set it in pom.xml:
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<scmReleaseCommitComment>@{prefix} my comment @{releaseLabel}</scmReleaseCommitComment>
</configuration>
</plugin>
[...]
</plugins>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Bruno Negrão Zica |