2016-06-29 74 views
0

我的build.gradle配置爲:搖籃轉換HTTPS Maven倉庫到http請求443

repositories { 
    mavenLocal() 
    mavenCentral() 
    jcenter() 
    maven { 
     url "https://<myrepo>/repo" 
    } 
} 

然而,

$ gradle build --debug 

給我:

[...] 
12:01:58.487 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] setting 'https.proxyHost' to '<myrepo>' 
[...] 
12:01:59.070 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: https://repo1.maven.org/maven2/org/xbib/archive/maven-metadata.xml 
12:01:59.316 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default 
12:01:59.324 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context 
12:01:59.325 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {tls}->http://<myrepo>:443->https://repo1.maven.org:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20] 
12:01:59.336 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 0][route: {tls}->http://<myrepo>:443->https://repo1.maven.org:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20] 
12:01:59.337 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {tls}->http://<myrepo>:443->https://repo1.maven.org:443 
12:01:59.340 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to <myrepo>/<reposerverIP>:443 
12:01:59.342 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established <localIP>:49298<-><reposerverIP>:443 
12:01:59.346 [DEBUG] [org.apache.http.impl.conn.DefaultHttpResponseParser] Garbage in response: 
[...] 
12:01:59.347 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-0: Close connection 
12:01:59.347 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-0: Shutdown connection 
12:01:59.348 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded 
12:01:59.348 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-0: Close connection 
[...] 

...雖然我不知道,爲什麼Gradle感覺有動力將「https」配置轉換爲「http:...:443」。任何人有配置想法?

+0

我試圖建立一個基本的javax.net.ssl.HttpsURLConnection從我的客戶端到回購服務器 - 並且工作。所以,這個問題似乎不在Java方面,而僅僅是Gradle本身,甚至是Gradle和Java之間的錯誤配置。 – philburns

回答

0

因爲我沒能找到配置錯誤本身,我很高興有這個問題,只需

  1. 卸載搖籃完全
  2. 重新啓動Ubuntu和
  3. 重新安裝搖籃2.14解決。