Maven release due to git failure

I am trying to make an mvn release, but it does not work due to problems with git. I have done this several times before without this problem, and I really do not understand why and how this happens.

At first I did this by doing mvn release: I’ll get ready, but I will get around it by adding the last line shown below to my root-pom:

<artifactId>maven-release-plugin</artifactId> <configuration> <preparationGoals>clean install</preparationGoals> <pushChanges>false</pushChanges> 

But now, when I try to make mvn release: execute, I get the error message again:

 [INFO] Executing: cmd.exe /X /C "git clone file://C\Users\torbjornk\nfr\MyProject/ C:\Users\torbjornk\nfr\MyProject\target\checkout" [INFO] Working directory: C:\Users\torbjornk\nfr\MyProject\target [ERROR] The git-clone command failed. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Unable to checkout from SCM Provider message: The git-clone command failed. Command output: fatal: 'C:/Program Files (x86)/Git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

I don’t understand where the idea came from that my git -installation folder should be a git repository! The git clone-log command registered just before the error does not contain a link to this folder.

+7
source share
3 answers

Just add a great original answer to Tobb ..
I noticed that this was fixed, but there were problems with the new version. You should add it as a dependency on a plugin (not a project), for example.

 <!-- Appengine deploy at end of mvn release:perform --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.2.2</version> <dependencies> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-scm-plugin</artifactId> <version>1.8.1</version> </dependency> </dependencies> </plugin> 
+8
source

It turned out that it was a mistake that we encountered earlier. This is due to an error in maven-scm-provider-git, which leads to the fact that the link to the file in the local repository for verification will lose its ':' in "C: ...". (The error is described here: http://jira.codehaus.org/browse/SCM-662 )

We fixed this by copying a fixed version of jar to the local maven repository, but recently I cleaned up my local repository to check if our Nexus repository was working properly and thus got an uncommitted version of the jar in my local repo (doh!)

So, added a fixed version of jar to my local maven repository, the git clone-command command again contained a ":", and everything started working :)

Edit: This bug is fixed in version 2.4 of the maven release plugin.

+3
source

May be a problem with

 file://C\Users\torbjornk\nfr\MyProject/ 

? Can't you just clone using the usual path?

 C:\Users\torbjornk\nfr\MyProject/ 

If I do not think it should be:

 file:///C:/Users/torbjornk/nfr/MyProject/ 

If this does not work, try one of them:

 file://localhost/c|/Users/torbjornk/nfr/MyProject/ file:///c|/Users/torbjornk/nfr/MyProject/ file://localhost/c:/Users/torbjornk/nfr/MyProject/ 
0
source

All Articles