使用Java的Gitlab API连接到gitlab [英] Connect to gitlab using Java's Gitlab API

查看:3512
本文介绍了使用Java的Gitlab API连接到gitlab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确定哪些修改的文件和分支与特定的哈希码相关.因此,我正在尝试为此使用Java的GitLabAPI( Java的Gitlab API ).

I want to identify which modified files and branch are related to a specific hash code. So, I am trying to use the Java's GitLabAPI (Java's Gitlab API) for this.

我的问题是用于执行此实现的路径.

My question is Which path to use to make this implementation.

我在Internet上浏览了一下,并尝试将我连接到这样的存储库:

I took a look on the Internet and tried connect me with repository like this:

GitlabSession session = GitlabAPI.connect(host, "user", "key");
GitlabAPI api = GitlabAPI.connect(host, session.getPrivateToken());

但是,发生以下错误:

16:03:17,080 ERROR [STDERR] java.net.SocketException: Connection reset
16:03:17,081 ERROR [STDERR]     at java.net.SocketInputStream.read(Unknown Source)
16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
16:03:17,081 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
16:03:17,081 ERROR [STDERR]     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
16:03:17,081 ERROR [STDERR]     at org.gitlab.api.http.GitlabHTTPRequestor.submitData(GitlabHTTPRequestor.java:339)
16:03:17,081 ERROR [STDERR]     at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:160)
16:03:17,081 ERROR [STDERR]     at org.gitlab.api.http.GitlabHTTPRequestor.to(GitlabHTTPRequestor.java:139)
16:03:17,081 ERROR [STDERR]     at org.gitlab.api.GitlabAPI.connect(GitlabAPI.java:54)

我必须怎么做才能连接到存储库?

What do I have to do to get connected to the repository?

推荐答案

也许是与SSL证书有关的问题,您是否将其导入了JVM?

Maybe it's a problem related to the SSL certifcate, did you imported it in you JVM?

我使用了另一个类似的库( https://github.com/gmessner/gitlab4j-api),然后在URL参数中设置以下内容: https://myserver.it/gitlab

I used another similar library (https://github.com/gmessner/gitlab4j-api) and in the URL parameter i set something like this: https://myserver.it/gitlab

这篇关于使用Java的Gitlab API连接到gitlab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆