mvn release:prepare not committing changes to pom.xml mvn release:prepare not committing changes to pom.xml jenkins jenkins

mvn release:prepare not committing changes to pom.xml


I solved the issue on my side (running maven 3.0.5) by updating the git scm provider dependency, not the release plugin version:

<build>  <plugins>    <plugin>      <artifactId>maven-release-plugin</artifactId>      <version>2.4.2</version>      <dependencies>        <dependency>          <groupId>org.apache.maven.scm</groupId>          <artifactId>maven-scm-provider-gitexe</artifactId>          <version>1.8.1</version>        </dependency>       </dependencies>      </plugin>    </plugins></build>

The git scm 1.8.1 version correctly makes the git commit (tested with the prepare and rollback goals).

EDIT: Different versions of maven-release-plugin and maven-scm-provider-gitexe may be required depending on your environment. See the comments for more discussion.


I ran into the same problem, solution by #richnou works for me (upgrading SCM dependency).There is the issue created on this problem, see link below. The problem relates with new version of Git where "git status" returns localized messages which plugin cannot parse. It is the root cause. The issue was fixed in git scm (1.8.1 version) by using --porcelain option of git (which should return easily parsable output), but after this fix, another problem has raised - if repository root (scm tag) is not the working directory, release:prepare still fails. This issue seems to be fixed in snapshot version of Git SCM (not released yet). This can be workarounded by copiing scm tag into child pom.

MRELEASE-812

SCM-709

maven-release-plugin-and-git-fix


Firstly, the answers from richnou and vasekt solved my problem I thought I'd post this answer just because of newer versions than have been mentioned and I thought it would be good to give an extra example including them.

I was running maven release plugin 2.3.2 with Git 3.3.x without specifying the maven scm dependency version, which was causing the snapshot issue. For me I just upgraded to the latest version at the time for both maven release plugin and the scm dependency which were as follows:

<plugin>   <artifactId>maven-release-plugin</artifactId>   <version>2.5.3</version>   <dependencies>      <dependency>         <groupId>org.apache.maven.scm</groupId>         <artifactId>maven-scm-provider-gitexe</artifactId>         <version>1.9.5</version>      </dependency>   </dependencies></plugin>

This worked fine for me, release versions uploaded properly to the release repo and the snapshot worked as expected as well.