I have a sample from Gaelyk (called Bloogie) and it is using gradlew
Problem is that i am behid a proxy.
Read gradle docs and found this:
gradle.properties
systemProp.http.proxyHost=www.somehost.org systemProp.http.proxyPort=8080 systemProp.http.proxyUser=userid systemProp.http.proxyPassword=password
but i have no clue how to put this info into the wrapper gradlew
Any idea ?
bmuschko1
(Benjamin Muschko)
January 20, 2012, 12:26pm
2
You can set system properties within your gradlew script by using one the environment variables DEFAULT_JVM_OPTS, JAVA_OPTS or GRADLE_OPTS.
DEFAULT_JVM_OPTS="-Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080 -Dhttp.proxyUser=userid -Dhttp.proxyPassword=password"
1 Like
Thanks
when i do not use any options and i used gradlew.bat as it is i get
C:\Downloads\glaforge-bloogaey-3cde055>gradlew Downloading http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-b in.zip Exception in thread âmainâ java.net.ConnectException: Connection refused: connectâŚ
when i tried your solution by modifying gradlew.bat by adding this:
set GRADLE_OPTS=%JAVA_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%" -Dhttp.proxyHost=x.x.x.x -Dhttp.proxyPort=x -Dhttp.proxyUser=x -Dhttp.proxyPassword=x
then i get
C:\Downloads\glaforge-bloogaey-3cde055>gradlew Downloading http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-b in.zip Exception in thread âmainâ java.io.IOException: Server returned HTTP response co de: 407 for URL: http://repo.gradle.org/gradle/distributions/gradle-1.0-mileston e-3-bin.zip
What am i doing wrong here ?
Thanks
I come back with a link i discovered at stackoverflow which describe the same problemâŚ:
http://stackoverflow.com/questions/5991194/gradle-proxy-configuration
http://issues.gradle.org/browse/GRADLE-1556
Apparenlty is still open the issueâŚ
The links you give are outdated. Have you tried with the latest milestone?
I used gradlew.bat that came with gradle-wrapper.jar in a project that i took from githubâŚthere is a newer version of gradle-wrapper.jar ?
The wrapper Jar doesnât determine the version of Gradle. You have to update gradle-wrapper.properties to point to the latest Gradle distribution.
But the problem seem to be in the gradlew code:
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon n.java:1436)
at org.gradle.wrapper.Download.downloadInternal(Download.java:49)
at org.gradle.wrapper.Download.download(Download.java:37)
at org.gradle.wrapper.Install.createDist(Install.java:54)
at org.gradle.wrapper.Wrapper.execute(Wrapper.java:80)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:37)
This is the property you say i should change ?
distributionUrl=http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip
that is okâŚthe problem is on authentication like is describen on stackoverflowâŚlike user name and pass are not recognized
Downloading http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-b in.zip
Exception in thread âmainâ java.io.IOException: Server returned HTTP response co de: 407 for URL: http://repo.gradle.org/gradle/distributions/gradle-1.0-mileston e-3-bin.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:1436)
at org.gradle.wrapper.Download.downloadInternal(Download.java:49)
at org.gradle.wrapper.Download.download(Download.java:37)
at org.gradle.wrapper.Install.createDist(Install.java:54)
at org.gradle.wrapper.Wrapper.execute(Wrapper.java:80)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:37)
Sorry, I didnât get that the Gradle download is the problem. What you could do is to generate the wrapper with milestone 7 and check if the problem still exists.
Ok âŚhow can i generate it ?
âŚjust a small direction âŚ
I have downloaded lates gradle with sourcesâŚ
Add and execute this task:
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-7'
}
Manages to do this and i have the new gradle-wrapper.jar and new prop file but still the same problem.
c:\Downloads\glaforge-bloogaey-3cde055>gradlew Downloading http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-7-b in.zip
Exception in thread âmainâ java.io.IOException: Server returned HTTP response co de: 407 for URL: http://repo.gradle.org/gradle/distributions/gradle-1.0-mileston e-7-bin.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:1436)
at org.gradle.wrapper.Download.downloadInternal(Download.java:49)
at org.gradle.wrapper.Download.download(Download.java:37)
at org.gradle.wrapper.Install.createDist(Install.java:58)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:117)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:53)
Does the Download.downloadInternal take into consideration the username and password i set via -D propety
set GRADLE_OPTS=%JAVA_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%" -Dhttp.proxyHost=158.169.xxx.xxx-Dhttp.proxyPort=80xx -Dhttp.proxyUser=xxx -Dhttp.proxyPassword=xxx
It looks like is the same problem as described on the link i posted above on stackoverflow but this time is for the gradle wrapper not for gradle itself.
The problem is already solved for Gradle itself, but apparently it isnât solved for the Wrapper.
daz
January 23, 2012, 11:59pm
15
Peterâs right. The Gradle Wrapper uses regular java.net.URL to download the Gradle distro. The URL class supports âhttp.proxyHostâ and âhttp.proxyPortâ out of the box, but requires extra configuration to handle proxy authorisation.
This is GRADLE-1679.
Thatâs what i discovered and said as wellâŚwill do a local patch for myself and if itâs ok i submit for a patch (merge)
ok solved the problem for meâŚadded the solution to http://issues.gradle.org/browse/GRADLE-1679 as comment.