gpt4 book ai didi

git - Jenkins 中的 Bitbucket 不工作

转载 作者:行者123 更新时间:2023-11-28 23:59:52 24 4
gpt4 key购买 nike

我正在尝试使用 bitbucket 在 git 中设置我的 tomcat 项目。

我有一个远程服务器,我在其中安装了 tomcat 和 jenkins。

我配置了 java sdk 和 maven。

我使用 bitbicket url,正如许多帖子中建议的那样

https://user:pass@bitbucket.org/user/project.git

但是当它构建时它会抛出这个:

    Started by user anonymous
Building in workspace /root/.jenkins/jobs/PROJECT/workspace

git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url https://USER:mypass@bitbucket.org/USER/PROJECT.git # timeout=10 Fetching upstream changes from https://USER@bitbucket.org/USER/PROJECT.git git --version # timeout=10 git fetch --tags --progress https://USER@bitbucket.org/USER/PROJECT.git +refs/heads/:refs/remotes/origin/ ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://USER@bitbucket.org/USER/PROJECT.git 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:1744) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://USER@bitbucket.org/USER/PROJECT.git +refs/heads/:refs/remotes/origin/" returned status code 128: stdout: stderr: error: The requested URL returned error: 401 while accessing https://USER@bitbucket.org/USER/PROJECT.git/info/refs

致命:HTTP 请求失败

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

错误:获取远程仓库“来源”时出错完成:失败

请帮忙!

最佳答案

我终于让它可以在根文件夹中创建文件 .netrc。

我使用了这个链接 TUTORIAL

然后在 jenkins 中使用简单的 bitbucket url

https://bitbucket.org/user/project.git

我用的是 CentOs

关于git - Jenkins 中的 Bitbucket 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31323899/

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