问题描述
我正在尝试发布mvn,但由于git问题而失败。我之前多次做过这个,没有这个问题,我真的不知道为什么/这是怎么发生的。
I am trying to do a mvn release, but it fails due to problems with git. I have done this multiple times before without this problem, and I really don't get why/how this is happening.
我第一次使用mvn发布版本:prepare,但是通过将下面显示的最后一行添加到我的root-pom中来解决它:
I first got it doing mvn release:prepare, but got 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>
但是现在,当我尝试执行mvn release时:perform,我再次收到错误消息:
But now, when I try to do mvn release:perform, 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
我不明白我的git-installation-folder应该是一个git仓库!在错误发生之前记录下来的git clone-command不包含对这个文件夹的引用。
I do not get where it gets the idea that my git-installation-folder is supposed to be a git repository! The git clone-command logged right before the error is happening does not contain a reference to this folder either..
推荐答案
添加到的优秀原始答案。
我注意到这已被修复,但已问题得到新版本的工作..
您必须添加它作为插件(而不是项目)的依赖项,例如。
Just to add to Tobb's excellent original answer..
I noticed that this has been fixed but had issues getting the new version to work..You have to add it as a plugin (not project) dependency, eg.
<!-- 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>
这篇关于由于git失败,Maven发布失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!