I'm setting up a Jenkins job in a salve machine and I'm new to Linux shell. Now I have a problem:
Logged in as jenkins(a user account set for Jenkins job), it execute ./gradlew, than it will start to download https://downloads.gradle.org/distributions/gradle-2.10-bin.zip, and it would fail because of the bad network, while it will start to run gradle normally if it executed "sudo ./gradlew".
Can someone help and tell me, how to make "./gradlew" the same as "sudo ./gradlew" as the user jenkins?
The shell scripts were from git for all, so I cannot modify it by adding "sudo".
Adding log in my real working scenario:
jenkins@reed:/local/jenkins/workspace/SV_TEST_/automation/robot$ id
uid=180(jenkins) gid=0(root) group=0(root)
jenkins@reed:/local/jenkins/workspace/SV_TEST_/automation/robot$ sudo ./gradlew webAPI:compileJava
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
:common:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
:common:processResources UP-TO-DATE
:common:classes
:common:jar
:webAPI:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
BUILD SUCCESSFUL
Total time: 10.204 secs
jenkins@reed:/local/jenkins/workspace/SV_TEST_/automation/robot$ /local/jenkins/workspace/SV_TEST/automation/robot/gradlew -g /local/jenkins/.gradle -p /local/jenkins/workspace/SV_TEST/automation/robot clean
Downloading https://services.gradle.org/distributions/gradle-2.10-bin.zip
...