Jenkins Git Plugin
问题描述:
从gitHub存储库为poc尝试Jenkins版本的项目时,出现以下错误。詹金斯是本地安装,我使用https地址作为git,用户名和密码用于登录到GitHub。任何人都可以给我一些指点这里,因为我是新来的都詹金斯和GitHub的Jenkins Git Plugin
Building in workspace C:\Program Files (x86)\Jenkins\workspace\AdventureWorks2014 - 1. Build
Cloning the remote Git repository
Cloning repository https://github.com/h020905a/AdventureWorks2014.git
> git.exe init C:\Program Files (x86)\Jenkins\workspace\AdventureWorks2014 - 1. Build # timeout=10
Fetching upstream changes from https://github.com/h020905a/AdventureWorks2014.git
> git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
> git.exe fetch --tags --progress https://github.com/h020905a/AdventureWorks2014.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Error performing git command
\t at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1793)
\t at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1513)
\t at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
\t at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
\t at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
\t at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
\t at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
\t at hudson.scm.SCM.checkout(SCM.java:495)
\t at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
\t at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
\t at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
\t at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
\t at hudson.model.Run.execute(Run.java:1728)
\t at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
\t at hudson.model.ResourceController.execute(ResourceController.java:98)
\t at hudson.model.Executor.run(Executor.java:404)
Caused by: org.jvnet.winp.WinpException: Failed to read RT_USER_PROCESS_PARAMETERS error=299 at envvar-cmdline.cpp:151
\t at org.jvnet.winp.Native.getCmdLineAndEnvVars(Native Method)
\t at org.jvnet.winp.WinProcess.parseCmdLineAndEnvVars(WinProcess.java:126)
\t at org.jvnet.winp.WinProcess.getCommandLine(WinProcess.java:102)
\t at hudson.util.ProcessTree$Windows$1.getArguments(ProcessTree.java:444)
\t at hudson.plugins.msbuild.MsBuildKillingVeto.vetoProcessKilling(MsBuildKillingVeto.java:56)
\t at hudson.util.ProcessTree$OSProcess.getVeto(ProcessTree.java:242)
\t at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:425)
\t at hudson.util.ProcessTree.killAll(ProcessTree.java:145)
\t at hudson.Proc$LocalProc.destroy(Proc.java:380)
\t at hudson.Proc$LocalProc.join(Proc.java:353)
\t at hudson.Proc.joinWithTimeout(Proc.java:166)
\t at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1780)
\t ... 15 more
ERROR: null
Finished: FAILURE
答
如果你的GitHub的登录密码包含特殊字符,那么你所面临的问题可能是类似问题描述在这张票: https://issues.jenkins-ci.org/browse/JENKINS-38655
你可以尝试让你的工作使用JGit。如果您不使用TFS,但在特定用户的密码中有特殊字符(如插入符号或符号或单引号或双引号),则可以使用此标记可能是JENKINS-38194的副本,这种情况下的解决方法可能是将该作业从使用命令行git实现切换到使用JGit实现.JGit实现需要先从“Manage Jenkins”,“全局工具配置“,”Git“,那么每个作业都会有一个选择列表,让您选择该作业是否应该使用命令行git或JGit。”
答
通过将github中的分支切换为主并使公共回购解决了该问题。