When using git-1.8.5, with maven-release-plugin (tested with versions 2.4.2 and 2.3.2) with mvn (tested with versions 3.1.1 and 3.0.5), running mvn release:prepare
and mvn release:prepare-with-pom
fails.
mvn release:prepare
fails to create the commits that it's supposed to create:
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release foo-1.0.0
and mvn release:prepare-with-pom
fails with a git error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.2:prepare-with-pom (default-cli) on project foo: Cannot remove release POMs from SCM
[ERROR] Provider message:
[ERROR] The git command failed.
[ERROR] Command output:
[ERROR] error: the following file has changes staged in the index:
[ERROR] release-pom.xml
[ERROR] (use --cached to keep the file, or -f to force removal)
[ERROR] -> [Help 1]
[ERROR]
As per Mark Derricutt's solution, explicitly add the maven-scm-provider-gitexe:1.8.1 dependency to the maven-release-plugin:2.4.2 plugin:
<build>
<plugins>
<!-- ... -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<!-- This version is necessary for use with git version 1.8.5 -->
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Background:
git status
, so now scripts like maven-release-plugin should use the porcelain option git status --porcelain
instead of git status
.maven-scm-provider-gitexe:1.8
with maven-release-plugin:2.4.2.--porcelain
flag with maven-scm-provider-gitexe:1.8.1, but maven-release-plugin:2.4.2 does not have its dependency for maven-scm-provider-gitexe updated yet. See https://jira.codehaus.org/browse/SCM-686 for more info.This appears to have been fixed in version 2.5 of maven-release-plugin, which was released on March 5th.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With