我正在尝试解决 gradle 项目的依赖关系,当我打开项目并尝试同步 gradle 时,出现以下错误:
错误:连接超时:连接。如果您使用 HTTP 代理,请在 IDE 或 Gradle 中配置代理设置。
然后我意识到我需要在gradle中配置公司网络的代理,我在gradle.properties
文件中设置了代理:
systemProp.http.proxyHost=someIP
systemProp.http.proxyPort=somePort
systemProp.http.proxyUser=user
systemProp.http.proxyPassword=pswd
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.https.proxyHost=someIP
systemProp.https.proxyPort=somePort
systemProp.https.proxyUser=user
systemProp.https.proxyPassword=pswd
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
然后我尝试同步 gradle 项目,但我得到了同样的错误:
错误:连接超时:连接。如果您使用 HTTP 代理,请在 IDE 或 Gradle 中配置代理设置。
该gradle.properties
文件位于以下路径中:
project/gradle.properties
我gradlew.bat
从命令行执行,我得到了下一个异常:
Exception in thread "main"
javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Alerts.java: 208)
at sun.security.ssl.Alerts.getSSLException(Alerts.java: 154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java: 1979)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java: 1086)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java: 1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java: 1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java: 1343)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:
559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java: 185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java: 1301)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http sURLConnectionImpl.java: 254)
at org.gradle.wrapper.Download.downloadInternal(Download.java: 56)
at org.gradle.wrapper.Download.download(Download.java: 42)
at org.gradle.wrapper.Install$1.call(Install.java: 57)
at org.gradle.wrapper.Install$1.call(Install.java: 44)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java: 65)
at org.gradle.wrapper.Install.createDist(Install.java: 44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java: 126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java: 56)