Gradle failing to download distribution behind company proxy
Trying to get Jenkins behind my corp proxy to build my java library project and it keeps timing out during download of the distribution. I've followed many guides on trying to get gradle to utilize proxy settings in the gradle.properties
file build it doesn't seem to work. I know the proxyHost and proxyPort is correct. Is there something that I'm overlooking or is it a different issue other than the proxy?
build.gradle
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
sourceCompatibility = 1.8
def baseVersion = "1.0"
def jenkinsBuildNumber = System.getenv('BUILD_NUMBER')
version = jenkinsBuildNumber != null ? baseVersion + "." + jenkinsBuildNumber : baseVersion
println 'Version: ' + version
group = 'com.company.MyLibrary'
repositories
mavenCentral()
apply plugin: 'groovy'
jar
from "LICENSE.md"
dependencies
compile "com.google.guava:guava:19.0"
compile "junit:junit:4.12"
compile "org.assertj:assertj-core:3.2.0"
compile "org.mockito:mockito-core:2.0.31-beta"
compile "org.powermock:powermock-module-junit4:1.6.2"
compile "org.powermock:powermock-api-mockito:1.6.2"
testCompile "com.google.guava:guava:19.0"
testCompile "junit:junit:4.12"
testCompile "org.assertj:assertj-core:3.2.0"
testCompile "org.mockito:mockito-core:2.0.31-beta"
testCompile "org.powermock:powermock-module-junit4:1.6.2"
testCompile "org.powermock:powermock-api-mockito:1.6.2"
task sourcesJar(type: Jar)
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
task javadocJar(type: Jar, dependsOn: javadoc)
classifier = 'javadoc'
from javadoc.destinationDir
artifacts
archives sourcesJar
archives javadocJar
task wrapper(type: Wrapper)
gradleVersion = '2.10'
distributionUrl = "http://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
gradle.properties
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8989
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8989
systemProp.https.nonProxyHosts=*.company.com|localhost
org.gradle.daemon=true
Jenkins console output
20:45:09 Started by an SCM change
20:45:09 [EnvInject] - Loading node environment variables.
20:45:09 Building on master in workspace /var/lib/jenkins/workspace/MyLibrary
20:45:09 [WS-CLEANUP] Deleting project workspace...
20:45:09 [WS-CLEANUP] Done
20:45:09 Cloning the remote Git repository
20:45:09 Cloning repository ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git init /var/lib/jenkins/workspace/MyLibrary # timeout=10
20:45:09 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git --version # timeout=10
20:45:09 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:10 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:11 Seen branch in repository origin/master
20:45:11 Seen 1 remote branch
20:45:11 Checking out Revision 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa (origin/master)
20:45:11 > git config core.sparsecheckout # timeout=10
20:45:11 > git checkout -f 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa
20:45:11 > git rev-list 66fe56731f935be83c91e38ced426aea7bba0b8f # timeout=10
20:45:11 [EnvInject] - Injecting environment variables from a build step.
20:45:11 [Gradle] - Launching build.
20:45:11 [MyLibrary] $ /var/lib/jenkins/workspace/MyLibrary/gradlew -Dcommit=master clean test
20:45:11 Downloading http://services.gradle.org/distributions/gradle-2.10-all.zip
20:47:18
20:47:18 Exception in thread "main" java.net.ConnectException: Connection timed out
20:47:18 at java.net.PlainSocketImpl.socketConnect(Native Method)
20:47:18 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
20:47:18 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
20:47:18 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
20:47:18 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
20:47:18 at java.net.Socket.connect(Socket.java:589)
20:47:18 at java.net.Socket.connect(Socket.java:538)
20:47:18 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
20:47:18 at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
20:47:18 at sun.net.www.http.HttpClient.New(HttpClient.java:308)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1175)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1123)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
20:47:18 at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
20:47:18 at org.gradle.wrapper.Download.download(Download.java:44)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:61)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:48)
20:47:18 at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
20:47:18 at org.gradle.wrapper.Install.createDist(Install.java:48)
20:47:18 at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
20:47:18 at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
20:47:18 Build step 'Invoke Gradle script' changed build result to FAILURE
20:47:18 Build step 'Invoke Gradle script' marked build as failure
20:47:18 Finished: FAILURE
java jenkins gradle proxy
|
show 4 more comments
Trying to get Jenkins behind my corp proxy to build my java library project and it keeps timing out during download of the distribution. I've followed many guides on trying to get gradle to utilize proxy settings in the gradle.properties
file build it doesn't seem to work. I know the proxyHost and proxyPort is correct. Is there something that I'm overlooking or is it a different issue other than the proxy?
build.gradle
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
sourceCompatibility = 1.8
def baseVersion = "1.0"
def jenkinsBuildNumber = System.getenv('BUILD_NUMBER')
version = jenkinsBuildNumber != null ? baseVersion + "." + jenkinsBuildNumber : baseVersion
println 'Version: ' + version
group = 'com.company.MyLibrary'
repositories
mavenCentral()
apply plugin: 'groovy'
jar
from "LICENSE.md"
dependencies
compile "com.google.guava:guava:19.0"
compile "junit:junit:4.12"
compile "org.assertj:assertj-core:3.2.0"
compile "org.mockito:mockito-core:2.0.31-beta"
compile "org.powermock:powermock-module-junit4:1.6.2"
compile "org.powermock:powermock-api-mockito:1.6.2"
testCompile "com.google.guava:guava:19.0"
testCompile "junit:junit:4.12"
testCompile "org.assertj:assertj-core:3.2.0"
testCompile "org.mockito:mockito-core:2.0.31-beta"
testCompile "org.powermock:powermock-module-junit4:1.6.2"
testCompile "org.powermock:powermock-api-mockito:1.6.2"
task sourcesJar(type: Jar)
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
task javadocJar(type: Jar, dependsOn: javadoc)
classifier = 'javadoc'
from javadoc.destinationDir
artifacts
archives sourcesJar
archives javadocJar
task wrapper(type: Wrapper)
gradleVersion = '2.10'
distributionUrl = "http://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
gradle.properties
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8989
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8989
systemProp.https.nonProxyHosts=*.company.com|localhost
org.gradle.daemon=true
Jenkins console output
20:45:09 Started by an SCM change
20:45:09 [EnvInject] - Loading node environment variables.
20:45:09 Building on master in workspace /var/lib/jenkins/workspace/MyLibrary
20:45:09 [WS-CLEANUP] Deleting project workspace...
20:45:09 [WS-CLEANUP] Done
20:45:09 Cloning the remote Git repository
20:45:09 Cloning repository ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git init /var/lib/jenkins/workspace/MyLibrary # timeout=10
20:45:09 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git --version # timeout=10
20:45:09 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:10 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:11 Seen branch in repository origin/master
20:45:11 Seen 1 remote branch
20:45:11 Checking out Revision 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa (origin/master)
20:45:11 > git config core.sparsecheckout # timeout=10
20:45:11 > git checkout -f 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa
20:45:11 > git rev-list 66fe56731f935be83c91e38ced426aea7bba0b8f # timeout=10
20:45:11 [EnvInject] - Injecting environment variables from a build step.
20:45:11 [Gradle] - Launching build.
20:45:11 [MyLibrary] $ /var/lib/jenkins/workspace/MyLibrary/gradlew -Dcommit=master clean test
20:45:11 Downloading http://services.gradle.org/distributions/gradle-2.10-all.zip
20:47:18
20:47:18 Exception in thread "main" java.net.ConnectException: Connection timed out
20:47:18 at java.net.PlainSocketImpl.socketConnect(Native Method)
20:47:18 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
20:47:18 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
20:47:18 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
20:47:18 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
20:47:18 at java.net.Socket.connect(Socket.java:589)
20:47:18 at java.net.Socket.connect(Socket.java:538)
20:47:18 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
20:47:18 at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
20:47:18 at sun.net.www.http.HttpClient.New(HttpClient.java:308)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1175)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1123)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
20:47:18 at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
20:47:18 at org.gradle.wrapper.Download.download(Download.java:44)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:61)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:48)
20:47:18 at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
20:47:18 at org.gradle.wrapper.Install.createDist(Install.java:48)
20:47:18 at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
20:47:18 at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
20:47:18 Build step 'Invoke Gradle script' changed build result to FAILURE
20:47:18 Build step 'Invoke Gradle script' marked build as failure
20:47:18 Finished: FAILURE
java jenkins gradle proxy
Does your corp proxy use authentication?
– RaGe
Jan 6 '16 at 19:14
no it doesn't, good thought though, the gradle scripts work on my machine and the jenkins server is within the same vlan network
– Jon Erickson
Jan 6 '16 at 19:14
Are you certain the jenkins host can reach the general internet? I would try some curls or wgets from the server.
– RaGe
Jan 6 '16 at 19:27
i can wget the gradle-2.10-all.zip distribution just fine when ssh'd into the server...
– Jon Erickson
Jan 6 '16 at 19:35
1
For lack of better options, I would try:gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
just to rule out thatgradle.properties
is not being applied somehow.
– RaGe
Jan 6 '16 at 19:51
|
show 4 more comments
Trying to get Jenkins behind my corp proxy to build my java library project and it keeps timing out during download of the distribution. I've followed many guides on trying to get gradle to utilize proxy settings in the gradle.properties
file build it doesn't seem to work. I know the proxyHost and proxyPort is correct. Is there something that I'm overlooking or is it a different issue other than the proxy?
build.gradle
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
sourceCompatibility = 1.8
def baseVersion = "1.0"
def jenkinsBuildNumber = System.getenv('BUILD_NUMBER')
version = jenkinsBuildNumber != null ? baseVersion + "." + jenkinsBuildNumber : baseVersion
println 'Version: ' + version
group = 'com.company.MyLibrary'
repositories
mavenCentral()
apply plugin: 'groovy'
jar
from "LICENSE.md"
dependencies
compile "com.google.guava:guava:19.0"
compile "junit:junit:4.12"
compile "org.assertj:assertj-core:3.2.0"
compile "org.mockito:mockito-core:2.0.31-beta"
compile "org.powermock:powermock-module-junit4:1.6.2"
compile "org.powermock:powermock-api-mockito:1.6.2"
testCompile "com.google.guava:guava:19.0"
testCompile "junit:junit:4.12"
testCompile "org.assertj:assertj-core:3.2.0"
testCompile "org.mockito:mockito-core:2.0.31-beta"
testCompile "org.powermock:powermock-module-junit4:1.6.2"
testCompile "org.powermock:powermock-api-mockito:1.6.2"
task sourcesJar(type: Jar)
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
task javadocJar(type: Jar, dependsOn: javadoc)
classifier = 'javadoc'
from javadoc.destinationDir
artifacts
archives sourcesJar
archives javadocJar
task wrapper(type: Wrapper)
gradleVersion = '2.10'
distributionUrl = "http://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
gradle.properties
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8989
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8989
systemProp.https.nonProxyHosts=*.company.com|localhost
org.gradle.daemon=true
Jenkins console output
20:45:09 Started by an SCM change
20:45:09 [EnvInject] - Loading node environment variables.
20:45:09 Building on master in workspace /var/lib/jenkins/workspace/MyLibrary
20:45:09 [WS-CLEANUP] Deleting project workspace...
20:45:09 [WS-CLEANUP] Done
20:45:09 Cloning the remote Git repository
20:45:09 Cloning repository ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git init /var/lib/jenkins/workspace/MyLibrary # timeout=10
20:45:09 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git --version # timeout=10
20:45:09 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:10 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:11 Seen branch in repository origin/master
20:45:11 Seen 1 remote branch
20:45:11 Checking out Revision 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa (origin/master)
20:45:11 > git config core.sparsecheckout # timeout=10
20:45:11 > git checkout -f 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa
20:45:11 > git rev-list 66fe56731f935be83c91e38ced426aea7bba0b8f # timeout=10
20:45:11 [EnvInject] - Injecting environment variables from a build step.
20:45:11 [Gradle] - Launching build.
20:45:11 [MyLibrary] $ /var/lib/jenkins/workspace/MyLibrary/gradlew -Dcommit=master clean test
20:45:11 Downloading http://services.gradle.org/distributions/gradle-2.10-all.zip
20:47:18
20:47:18 Exception in thread "main" java.net.ConnectException: Connection timed out
20:47:18 at java.net.PlainSocketImpl.socketConnect(Native Method)
20:47:18 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
20:47:18 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
20:47:18 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
20:47:18 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
20:47:18 at java.net.Socket.connect(Socket.java:589)
20:47:18 at java.net.Socket.connect(Socket.java:538)
20:47:18 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
20:47:18 at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
20:47:18 at sun.net.www.http.HttpClient.New(HttpClient.java:308)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1175)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1123)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
20:47:18 at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
20:47:18 at org.gradle.wrapper.Download.download(Download.java:44)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:61)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:48)
20:47:18 at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
20:47:18 at org.gradle.wrapper.Install.createDist(Install.java:48)
20:47:18 at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
20:47:18 at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
20:47:18 Build step 'Invoke Gradle script' changed build result to FAILURE
20:47:18 Build step 'Invoke Gradle script' marked build as failure
20:47:18 Finished: FAILURE
java jenkins gradle proxy
Trying to get Jenkins behind my corp proxy to build my java library project and it keeps timing out during download of the distribution. I've followed many guides on trying to get gradle to utilize proxy settings in the gradle.properties
file build it doesn't seem to work. I know the proxyHost and proxyPort is correct. Is there something that I'm overlooking or is it a different issue other than the proxy?
build.gradle
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
sourceCompatibility = 1.8
def baseVersion = "1.0"
def jenkinsBuildNumber = System.getenv('BUILD_NUMBER')
version = jenkinsBuildNumber != null ? baseVersion + "." + jenkinsBuildNumber : baseVersion
println 'Version: ' + version
group = 'com.company.MyLibrary'
repositories
mavenCentral()
apply plugin: 'groovy'
jar
from "LICENSE.md"
dependencies
compile "com.google.guava:guava:19.0"
compile "junit:junit:4.12"
compile "org.assertj:assertj-core:3.2.0"
compile "org.mockito:mockito-core:2.0.31-beta"
compile "org.powermock:powermock-module-junit4:1.6.2"
compile "org.powermock:powermock-api-mockito:1.6.2"
testCompile "com.google.guava:guava:19.0"
testCompile "junit:junit:4.12"
testCompile "org.assertj:assertj-core:3.2.0"
testCompile "org.mockito:mockito-core:2.0.31-beta"
testCompile "org.powermock:powermock-module-junit4:1.6.2"
testCompile "org.powermock:powermock-api-mockito:1.6.2"
task sourcesJar(type: Jar)
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
task javadocJar(type: Jar, dependsOn: javadoc)
classifier = 'javadoc'
from javadoc.destinationDir
artifacts
archives sourcesJar
archives javadocJar
task wrapper(type: Wrapper)
gradleVersion = '2.10'
distributionUrl = "http://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
gradle.properties
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8989
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8989
systemProp.https.nonProxyHosts=*.company.com|localhost
org.gradle.daemon=true
Jenkins console output
20:45:09 Started by an SCM change
20:45:09 [EnvInject] - Loading node environment variables.
20:45:09 Building on master in workspace /var/lib/jenkins/workspace/MyLibrary
20:45:09 [WS-CLEANUP] Deleting project workspace...
20:45:09 [WS-CLEANUP] Done
20:45:09 Cloning the remote Git repository
20:45:09 Cloning repository ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git init /var/lib/jenkins/workspace/MyLibrary # timeout=10
20:45:09 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:09 > git --version # timeout=10
20:45:09 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:45:10 > git config remote.origin.url ssh://git@git.company.net/~jon/MyLibrary.git # timeout=10
20:45:10 Fetching upstream changes from ssh://git@git.company.net/~jon/MyLibrary.git
20:45:10 > git -c core.askpass=true fetch --tags --progress ssh://git@git.company.net/~jon/MyLibrary.git +refs/heads/*:refs/remotes/origin/*
20:45:11 Seen branch in repository origin/master
20:45:11 Seen 1 remote branch
20:45:11 Checking out Revision 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa (origin/master)
20:45:11 > git config core.sparsecheckout # timeout=10
20:45:11 > git checkout -f 2ece1927e5fb1d368aba28a107f6fe2c2accb9fa
20:45:11 > git rev-list 66fe56731f935be83c91e38ced426aea7bba0b8f # timeout=10
20:45:11 [EnvInject] - Injecting environment variables from a build step.
20:45:11 [Gradle] - Launching build.
20:45:11 [MyLibrary] $ /var/lib/jenkins/workspace/MyLibrary/gradlew -Dcommit=master clean test
20:45:11 Downloading http://services.gradle.org/distributions/gradle-2.10-all.zip
20:47:18
20:47:18 Exception in thread "main" java.net.ConnectException: Connection timed out
20:47:18 at java.net.PlainSocketImpl.socketConnect(Native Method)
20:47:18 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
20:47:18 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
20:47:18 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
20:47:18 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
20:47:18 at java.net.Socket.connect(Socket.java:589)
20:47:18 at java.net.Socket.connect(Socket.java:538)
20:47:18 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
20:47:18 at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
20:47:18 at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
20:47:18 at sun.net.www.http.HttpClient.New(HttpClient.java:308)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1175)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1123)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
20:47:18 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
20:47:18 at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
20:47:18 at org.gradle.wrapper.Download.download(Download.java:44)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:61)
20:47:18 at org.gradle.wrapper.Install$1.call(Install.java:48)
20:47:18 at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
20:47:18 at org.gradle.wrapper.Install.createDist(Install.java:48)
20:47:18 at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
20:47:18 at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
20:47:18 Build step 'Invoke Gradle script' changed build result to FAILURE
20:47:18 Build step 'Invoke Gradle script' marked build as failure
20:47:18 Finished: FAILURE
java jenkins gradle proxy
java jenkins gradle proxy
asked Jan 6 '16 at 19:00
Jon EricksonJon Erickson
77k34125160
77k34125160
Does your corp proxy use authentication?
– RaGe
Jan 6 '16 at 19:14
no it doesn't, good thought though, the gradle scripts work on my machine and the jenkins server is within the same vlan network
– Jon Erickson
Jan 6 '16 at 19:14
Are you certain the jenkins host can reach the general internet? I would try some curls or wgets from the server.
– RaGe
Jan 6 '16 at 19:27
i can wget the gradle-2.10-all.zip distribution just fine when ssh'd into the server...
– Jon Erickson
Jan 6 '16 at 19:35
1
For lack of better options, I would try:gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
just to rule out thatgradle.properties
is not being applied somehow.
– RaGe
Jan 6 '16 at 19:51
|
show 4 more comments
Does your corp proxy use authentication?
– RaGe
Jan 6 '16 at 19:14
no it doesn't, good thought though, the gradle scripts work on my machine and the jenkins server is within the same vlan network
– Jon Erickson
Jan 6 '16 at 19:14
Are you certain the jenkins host can reach the general internet? I would try some curls or wgets from the server.
– RaGe
Jan 6 '16 at 19:27
i can wget the gradle-2.10-all.zip distribution just fine when ssh'd into the server...
– Jon Erickson
Jan 6 '16 at 19:35
1
For lack of better options, I would try:gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
just to rule out thatgradle.properties
is not being applied somehow.
– RaGe
Jan 6 '16 at 19:51
Does your corp proxy use authentication?
– RaGe
Jan 6 '16 at 19:14
Does your corp proxy use authentication?
– RaGe
Jan 6 '16 at 19:14
no it doesn't, good thought though, the gradle scripts work on my machine and the jenkins server is within the same vlan network
– Jon Erickson
Jan 6 '16 at 19:14
no it doesn't, good thought though, the gradle scripts work on my machine and the jenkins server is within the same vlan network
– Jon Erickson
Jan 6 '16 at 19:14
Are you certain the jenkins host can reach the general internet? I would try some curls or wgets from the server.
– RaGe
Jan 6 '16 at 19:27
Are you certain the jenkins host can reach the general internet? I would try some curls or wgets from the server.
– RaGe
Jan 6 '16 at 19:27
i can wget the gradle-2.10-all.zip distribution just fine when ssh'd into the server...
– Jon Erickson
Jan 6 '16 at 19:35
i can wget the gradle-2.10-all.zip distribution just fine when ssh'd into the server...
– Jon Erickson
Jan 6 '16 at 19:35
1
1
For lack of better options, I would try:
gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
just to rule out that gradle.properties
is not being applied somehow.– RaGe
Jan 6 '16 at 19:51
For lack of better options, I would try:
gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
just to rule out that gradle.properties
is not being applied somehow.– RaGe
Jan 6 '16 at 19:51
|
show 4 more comments
2 Answers
2
active
oldest
votes
My solution was to update my global ~/.gradle/gradle.properties
file with the correct proxy settings:
org.gradle.daemon=true
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8181
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8181
systemProp.https.nonProxyHosts=*.company.com|localhost
this is in effect, the same as passing these as command line args to gradlew
(./gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
add a comment |
For me it worked by using the following lines to the gradle.properties application folder
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8080
systemProp.https.proxyPassword=
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8080
systemProp.http.proxyPassword=
systemProp.https.nonProxyHosts=*.company.com|localhost
Do not forgot to enter also your password for the proxy.
Hope this helps
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34640698%2fgradle-failing-to-download-distribution-behind-company-proxy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
My solution was to update my global ~/.gradle/gradle.properties
file with the correct proxy settings:
org.gradle.daemon=true
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8181
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8181
systemProp.https.nonProxyHosts=*.company.com|localhost
this is in effect, the same as passing these as command line args to gradlew
(./gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
add a comment |
My solution was to update my global ~/.gradle/gradle.properties
file with the correct proxy settings:
org.gradle.daemon=true
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8181
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8181
systemProp.https.nonProxyHosts=*.company.com|localhost
this is in effect, the same as passing these as command line args to gradlew
(./gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
add a comment |
My solution was to update my global ~/.gradle/gradle.properties
file with the correct proxy settings:
org.gradle.daemon=true
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8181
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8181
systemProp.https.nonProxyHosts=*.company.com|localhost
this is in effect, the same as passing these as command line args to gradlew
(./gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
My solution was to update my global ~/.gradle/gradle.properties
file with the correct proxy settings:
org.gradle.daemon=true
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8181
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8181
systemProp.https.nonProxyHosts=*.company.com|localhost
this is in effect, the same as passing these as command line args to gradlew
(./gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
answered Apr 27 '16 at 17:35
Jon EricksonJon Erickson
77k34125160
77k34125160
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
add a comment |
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
IN the project repository ?
– Raju yourPepe
Jul 5 '17 at 7:15
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
@RajuGujarati you could update the properties file in the project repo and it would work, but I'd say that wouldn't be something you would want to check into source control. I'd suggest you update the global properties file in your home directory, which for macOS is the file path I mentioned in the answer above
– Jon Erickson
Jul 6 '17 at 17:18
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
If disable offline mode to sync the external lib e.g. github.com/ncapdevi/FragNav How long should we wait until be build ? It seems Resolve dependencies 'app_debugApk' is normal behaviour..
– Raju yourPepe
Jul 7 '17 at 1:47
add a comment |
For me it worked by using the following lines to the gradle.properties application folder
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8080
systemProp.https.proxyPassword=
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8080
systemProp.http.proxyPassword=
systemProp.https.nonProxyHosts=*.company.com|localhost
Do not forgot to enter also your password for the proxy.
Hope this helps
add a comment |
For me it worked by using the following lines to the gradle.properties application folder
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8080
systemProp.https.proxyPassword=
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8080
systemProp.http.proxyPassword=
systemProp.https.nonProxyHosts=*.company.com|localhost
Do not forgot to enter also your password for the proxy.
Hope this helps
add a comment |
For me it worked by using the following lines to the gradle.properties application folder
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8080
systemProp.https.proxyPassword=
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8080
systemProp.http.proxyPassword=
systemProp.https.nonProxyHosts=*.company.com|localhost
Do not forgot to enter also your password for the proxy.
Hope this helps
For me it worked by using the following lines to the gradle.properties application folder
systemProp.https.proxyHost=proxy.company.net
systemProp.https.proxyPort=8080
systemProp.https.proxyPassword=
systemProp.http.proxyHost=proxy.company.net
systemProp.http.proxyPort=8080
systemProp.http.proxyPassword=
systemProp.https.nonProxyHosts=*.company.com|localhost
Do not forgot to enter also your password for the proxy.
Hope this helps
answered Nov 15 '18 at 14:23
Alex MAlex M
213
213
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34640698%2fgradle-failing-to-download-distribution-behind-company-proxy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Does your corp proxy use authentication?
– RaGe
Jan 6 '16 at 19:14
no it doesn't, good thought though, the gradle scripts work on my machine and the jenkins server is within the same vlan network
– Jon Erickson
Jan 6 '16 at 19:14
Are you certain the jenkins host can reach the general internet? I would try some curls or wgets from the server.
– RaGe
Jan 6 '16 at 19:27
i can wget the gradle-2.10-all.zip distribution just fine when ssh'd into the server...
– Jon Erickson
Jan 6 '16 at 19:35
1
For lack of better options, I would try:
gradlew -Dhttp.proxyHost=xxx -Dhttp.proxyPort=xxx -Dhttps.proxyHost=xxx -Dhttps.proxyPort=xxx
just to rule out thatgradle.properties
is not being applied somehow.– RaGe
Jan 6 '16 at 19:51