我是 Jenkins 的相对新手,我试图简单地从 Bitbucket 上存储的代码运行构建。我正在使用 git。我已将作业源代码控制设置为 https 协议(protocol):
网址:https://myaccount@bitbucket.org/myaccount/myrepo.git
凭据:用户名/密码
'build' 部分指向根目录中的 pom.xml 并运行干净的测试 maven 目标
我有 Git 插件 2.5.2
我正在将 Jenkins 作为 Windows 服务(Windows 10)运行。
构建项目的错误是
ERROR: Timeout after 10 minutes
git.exe config --local --remove-section credential # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://username@bitbucket.org/username/myrepo.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1720) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404) Caused by: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true fetch --tags --progress https://username@bitbucket.org/username/myrepo.git +refs/heads/:refs/remotes/origin/" returned status code -1:
欢迎任何建议
最佳答案
正如我在这里回答的那样 https://stackoverflow.com/a/43964812/908936 :
尝试禁用使用 git 凭据缓存
git config --global --unset credential.helper
你可能还需要做
git config --system --unset credential.helper if this has been set in the system config file
关于git - Jenkins :错误:获取远程仓库时出错 'origin',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38391601/