【发布时间】:2020-02-10 23:00:58
【问题描述】:
我们正在为 Git 主分支上的 CI 管道开发 Azure Devops。我们的 pom.xml 文件中有 Version,一旦构建成功,需要更新并推送回 Git。
例如:-
<version>0.0.8-SNAPSHOT</version> 在 pom.xml 中
当我们运行时mvn --batch-mode release:prepare release:update-versions -DreleaseVersion=0.0.9 -DpushChanges=true 。它应该自动将更新的版本推送到 Git master 分支中的 pom.xml
当我们从本地终端运行上述命令时,它可以完美运行,但是当我们在 azure devops 上运行时失败,并出现以下错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.2:prepare (default-cli) on project ap-fds-bua-ccc-api: An error is occurred in the checkin process: Exception while executing SCM command. Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The process '/usr/share/maven/bin/mvn' failed with exit code 1
【问题讨论】:
-
只是检查提供的信息是否有用。如果您需要进一步的帮助,请告诉我们。
-
感谢@LeoLiu-MSFT 的回复。我已经在结帐了,这是同样的问题。让我再试一次并更新你。
标签: azure-devops maven-3