Jenkins为Maven项目构建失败

时间:2019-07-29 02:19:01

标签: github jenkins-pipeline

当我尝试构建时遇到以下错误时,我创建了一个公共存储库“微服务”并创建了一个从github管道构建工作的工作

Fetching upstream changes from https://github.com/karthiksuresh6666/microservices/new/master
 > C:\Program Files\Git\mingw64\bin\git.exe --version # timeout=10
 > C:\Program Files\Git\mingw64\bin\git.exe fetch --tags --progress https://github.com/karthiksuresh6666/microservices/new/master +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/karthiksuresh6666/microservices/new/master
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\mingw64\bin\git.exe fetch --tags --progress https://github.com/karthiksuresh6666/microservices/new/master +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: unable to update url base from redirection:
  asked for: https://github.com/karthiksuresh6666/microservices/new/master/info/refs?service=git-upload-pack
   redirect: https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fkarthiksuresh6666%2Fmicroservices%2Fnew%2Fmaster%2Finfo%2Frefs%3Fservice%3Dgit-upload-pack
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)

从远程获取时,它会重定向到登录页面,有没有办法设置我的github凭据,或者我在这里做错了什么。

1 个答案:

答案 0 :(得分:0)

karthiksuresh6666/microservices起,GitHub不应要求您进行身份验证。

尝试使用远程存储库URL https://github.com/karthiksuresh6666/microservices
(而不是https://github.com/karthiksuresh6666/microservices/new/master