【问题标题】:I am not able to build the job in jenkins,,,even I had given the path for github我无法在 jenkins 中建立工作,即使我已经给出了 github 的路径
【发布时间】:2015-09-30 18:35:22
【问题描述】:

我是 jenkins 的新手,我正试图在 jenkins 中创造一份工作。我已将我的项目推送到 github 并将 github 服务器的路径提供给 jenkins,但是当我尝试构建作业时,它显示错误并且无法构建......请帮助解决这个问题......

这是我得到的例外---

Started by user anonymous
Building in workspace C:\Users\hp\.jenkins\jobs\Spring\workspace
 > git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url git@github.com:rishi1020/SpringMVC # timeout=10
Fetching upstream changes from git@github.com:rishi1020/SpringMVC
 > git.exe --version # timeout=10
 > git.exe -c core.askpass=true fetch --tags --progress git@github.com:rishi1020/SpringMVC +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@github.com:rishi1020/SpringMVC
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:735)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:983)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1016)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1282)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Caused by: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true fetch --tags --progress git@github.com:rishi1020/SpringMVC +refs/heads/*:refs/remotes/origin/*" returned status code -1:
stdout: 
stderr: 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:733)
... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

【问题讨论】:

    标签: java github jenkins


    【解决方案1】:

    我怀疑,这可能是由于 Jenkins 中的 git 配置不正确。

    进入管理Jenkins -> 配置,git配置应该如下所示

    【讨论】:

      【解决方案2】:

      看起来不像是有效的 Github 存储库 URL。

      将其用作您的存储库 URL: https://github.com/rishi1020/SpringMVC.git

      【讨论】:

      【解决方案3】:

      我怀疑这是因为您的 jenkins 服务器无法使用您提供的 SSH 密钥对与 Github 通信。

      在您的 jenkins 可以从 Github 拉取代码进行构建之前,您首先必须确保下面的 git 命令可以在您的命令行中正常运行。

      cd C:\Users\hp\.jenkins\jobs\Spring\workspace
      git clone git@github.com:rishi1020/SpringMVC
      

      上面的命令可以正常运行后,就可以回到jenkins继续了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-09-28
        • 1970-01-01
        • 2015-04-30
        • 1970-01-01
        • 1970-01-01
        • 2021-10-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多