如何从NetBeans IDE 8和Jenkins重新连接到GitLab上的git存储库?

PJv*_*JvG 2 git netbeans repository jenkins gitlab

我的NetBeans git设置似乎出了点问题.我在Windows 8.1上使用NetBeans IDE 8.0.1,并且我在GitLab.com上托管了一个私有git存储库.但自从GitLab 更新到7.3.1版本以来,我无法从NetBeans连接到git存储库.如果我获取,拉取或推送无关紧要,我得到相同的响应:"无法通过https://gitlab.com/<group-name>/<project-name>.git连接到远程存储库"(组出于隐私原因,省略了名称和项目名称)

我发现类似(较旧)的问题,但我认为这不是同一个问题.我认为我的问题与GitLab Community Edition 7.3.1的发布有关,虽然我看不出究竟是什么原因造成的.

这个关于NetBeans社区的错误报告,有人建议单击"被动模式"可以解决问题,但我不知道在哪里可以找到这种被动模式.在谷歌搜索被动模式我认为它与FTP有关,但我使用https选项而不是ftps选项连接到git存储库,所以我不认为这真的适用于我的情况(纠正我,如果我错了.

关于NetBeans社区的其他错误报告有一个建议,我需要将以下行添加到我的git配置文件中:

[http]
    sslVerify=false
Run Code Online (Sandbox Code Playgroud)

我将它添加到我的项目文件夹中的.git/config文件和我的用户文件夹中的.gitconfig文件中,但这并没有解决问题.

另外从GitLab.com再次克隆git存储库并没有解决问题.事实上,当我尝试克隆时,我得到了相同的错误响应(如上所述).

如果我使用Git Bash for Windows,我仍然可以连接到git并执行所有git命令.所以我现在会使用它,但我也希望能够在NetBeans中使用Git Repository Browser.

编辑:

我还运行Jenkins自动构建和测试,它也连接到GitLab.com上的相同git存储库.我有一段时间没有检查它的日志,但它也无法获取.所以问题不仅限于NetBeans,因为Jenkins也受到了影响.

以下是Jenkins构建尝试的输出:

Started by user Pieterjan van Gastel
Building in workspace C:\Program Files (x86)\Jenkins\workspace\<project-name>
 > C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
 > C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url https://gitlab.com/<group-name>/<project-name>
Fetching upstream changes from https://gitlab.com/<group-name>/<project-name>
 > C:\Program Files (x86)\Git\bin\git.exe --version
FATAL: Failed to fetch from https://gitlab.com/<group-name>/<project-name>
hudson.plugins.git.GitException: Failed to fetch from https://gitlab.com/<group-name>/<project-name>
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:879)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1254)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
    at hudson.model.Run.execute(Run.java:1732)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Caused by: hudson.plugins.git.GitException: Received fatal alert: handshake_failure
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:2115)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1151)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:265)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620)
    ... 10 more
Run Code Online (Sandbox Code Playgroud)

同样,出于隐私原因,省略了组名和项目名称.

我想让我的单元测试自动执行,所以知道改变了什么以及如何修复它会很好.

此问题现在也作为NetBeans.orgGitLab邮件列表上的问题提交.

PJv*_*JvG 5

这个问题很容易解决.

John Gibson(@jgibson)评论了GitLab CE问题#624,他遇到了类似的错误.他解释说,他"发现服务器上的所有可用密码至少为256位.标准Oracle Java附带加密,对于某些算法,加密限制为128位.在安装Oracle的无限强度加密包之后,问题就消失了.请注意,无限强度套餐仅在美国合法使用.如果您在美国境外,那么我认为OpenJDK将起作用."

我按照他提到的链接,下载了Java Cryptography Extension(JCE)Unlimited Strength Jurisdiction Policy Files 7,并按照下载附带的自述文件中的步骤进行操作.

我重新启动了NetBeans,问题解决了.

这也适用于Eclipse IDE,如下面的SO问题所示:" Gitlab无法打开git-upload-pack错误 "

我还没有尝试过使用Jenkins,但我认为它同样容易修复.

我差点忘了,感谢Achilleas Pipis在GitLab邮件列表上找到了这个答案.