gpt4 book ai didi

devops - git.exe init # timeout=10 错误 : Error cloning remote repo 'origin' hudson. plugins.git

转载 作者:行者123 更新时间:2023-12-04 23:40:51 27 4
gpt4 key购买 nike

需要您帮助解决以下错误。

我可以从我的电脑运行 git clone 命令,但是当我尝试从 jenkins 运行它时,我遇到了以下错误。

错误:

Building in workspace C:\Tools\Jenkins\jobs\project A\workspace
Cloning the remote Git repository
Cloning repository git@github.com:scmgalaxy/helloworld-java-maven.git
> git.exe init C:\Tools\Jenkins\jobs\project A\workspace # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init C:\Tools\Jenkins\jobs\project A\workspace
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:656)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:463)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1039)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1079)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Error performing command: git.exe init C:\Tools\Jenkins\jobs\project A\workspace
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1726)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1695)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1691)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1321)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:654)
... 12 more
Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "C:\Tools\Jenkins\jobs\project A\workspace"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1715)
... 16 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 22 more
ERROR: null
Finished: FAILURE

最佳答案

您必须将路径设置为 git.exe在 Jenkins :

  • 你必须去http://yourjenkinsserver:8080/configureTools/
  • Path to Git executable旁边应该有一个字段.
  • 在该字段中输入您的 C:\Program Files\Git\mingw64\bin\git.exe 的路径.
  • 关于devops - git.exe init # timeout=10 错误 : Error cloning remote repo 'origin' hudson. plugins.git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38069452/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com