我們使用jgit作爲git項目來簽出並完成jenkins流程。它通過快照構建但下面的錯誤失敗的發佈版本:Jenkins發佈jgit問題
Building on master in workspace /home/jenkins2/jenkins/jobs/Git-end_to_end_4.0/workspace
Fetching changes from the remote Git repository
Checking out Revision 302b3bc2190db18b4661407ec67918e4f8ca65fc (refs/remotes/lighthouse/master)
Property '-Dm3plugin.lib' is already part of MAVEN_OPTS. This is usually a leftover of previous build which was forcibly stopped. Replacing the value with an updated one. Please remove it from the job configuration.
[RELEASE] Release build triggered
> jgit rev-parse --verify HEAD # timeout=10
ERROR: Failed to parse POMs
java.io.IOException: Failed retrieving current commit hash: Error performing command: jgit rev-parse --verify HEAD
at org.jfrog.hudson.release.scm.git.GitManager$CurrentCommitCallable.invoke(GitManager.java:194)
at org.jfrog.hudson.release.scm.git.GitManager$CurrentCommitCallable.invoke(GitManager.java:168)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at org.jfrog.hudson.release.scm.git.GitManager.getCurrentCommitHash(GitManager.java:52)
at org.jfrog.hudson.release.scm.git.GitCoordinator.prepare(GitCoordinator.java:74)
at org.jfrog.hudson.release.maven.MavenReleaseWrapper.setUp(MavenReleaseWrapper.java:131)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:643)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585)
at hudson.model.Run.execute(Run.java:1676)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
作爲參考,下面是我的版本的詳細信息:
詹金斯版本:詹金斯版本。 1.554
Git的客戶端插件:1.17.1
Git的插件:2.4.0
我曾參觀過幾個進出計算器的頁面,但並沒有得到適當的反應。將欣賞任何進一步的建議。
- https://git-scm.com/book/en/v2/Embedding-Git-in-your-Applications-JGit
- Determine Tracking Branch in JGit
- Is there a JGit method equivalent to git rev-parse --short?
- What does git rev-parse do?
我認爲GitManager類沒有提供jgit命令執行的實際輸出,也沒有很難說實際的失敗。你可以在jenkins工作區中手動運行jgit命令嗎? – centic
如果您要降級,請註明您的意見! – dildeepak
你在這方面取得進展的最佳選擇是回答我之前評論中的問題,這個問題顯然沒有足夠的信息,但任何人都沒有建議解決方案... – centic