Can not get gradle wrapper download the gradle distribution from local server

480 views Asked by At

I have created a simple local file server with Tomcat 8 and stored the distributions of the gradle. I planned to use the gradle wrapper to download the gradle from the local file server, because it is slow to download from the official site here. I can download the file from the file server in browser, but I have met some problems. I use Tomcat and HTTP protocol. When I specify the URL and start to download, Android Studio gives me an error:

Exception in thread "main" java.lang.RuntimeException:    java.io.IOException: Server returned HTTP response code: 500 for URL: http://yy.phiwifi.com/share/distributions/gradle-2.11-all.zip
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
    at org.gradle.wrapper.Install.createDist(Install.java:47)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://yy.phiwifi.com/share/distributions/gradle-2.11-all.zip
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
    at org.gradle.wrapper.Download.download(Download.java:45)
    at org.gradle.wrapper.Install$1.call(Install.java:60)
    at org.gradle.wrapper.Install$1.call(Install.java:47)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    ... 3 more

I don't know the reason, I thought maybe it is the protocol, I should use https, so I change the protocol and tried it again, but it still not working. Can anyone help me?

0

There are 0 answers