Jenkins构建时报错Error fetching remote repo ‘origin‘(已解决)

JavaSpringBoot构建问题:git同步与权限设置,
作者在集成Jenkins到JavaSpringBoot项目时遇到构建问题,解决步骤包括检查git地址配置、确认Jenkins用户权限以及清理工作空间后重试。问题可能源于git拉取错误或权限不足。

自己前几天在jinkens集成的java springboot项目,配置了构建后自动同步jar包文件并重启.一直没有问题,但是最近开了一个dev分支,两边有合并的操作,现在这里构建就出现了这个错误.乍一看就是git拉不到文件.

问题展示

问题解决

第一,可能是git地址配置的不对,这里请千万不要直接复制项目的请求地址,而是进项目点击Clone按钮复制地址;
第二,检查下jinkens配置的人员是否有权限;
第三,如果前面两个都没问题,那么就进入工作空间将之前构建的数据清理后重试(原因不知,但亲测有效).


Started by user codemylife Running as SYSTEM Building in workspace /var/jenkins_home/workspace/weblog-springboot The recommended git tool is: NONE using credential 87b14820-3dea-45ea-bc41-8d8a63927482 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/weblog-springboot/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://gitee.com/code-my-life/weblog.git # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://gitee.com/code-my-life/weblog.git at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999) at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1240) at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1311) at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1278) at hudson.scm.SCM.checkout(SCM.java:540) at hudson.model.AbstractProject.checkout(AbstractProject.java:1250) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:522) at hudson.model.Run.execute(Run.java:1860) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:454) Caused by: hudson.plugins.git.GitException: Command "git config remote.origin.url https://gitee.com/code-my-life/weblog.git" returned status code 128: stdout: stderr: fatal: not in a git directory at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2847) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2772) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2767) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2060) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2072) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1671) at PluginClassLoader for git-client//hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:182) at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:987) ... 12 more ERROR: Error fetching remote repo 'origin' Finished: FAILURE
08-25
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值