How to make "./gradlew" the same as "sudo ./gradlew"?
<p>I'm setting up a Jenkins job in a salve machine and I'm new to Linux shell. Now I have a problem: </p>

<p>Logged in as jenkins(a user account set for Jenkins job), it execute <strong>./gradlew</strong>, than it will start to download <a href="https://downloads.gradle.org/distributions/gradle-2.10-bin.zip" rel="nofollow">https://downloads.gradle.org/distributions/gradle-2.10-bin.zip</a>, and it would fail because of the bad network, while it will start to run gradle normally if it executed "<strong>sudo ./gradlew</strong>".</p>

<p>Can someone help and tell me, how to make "./gradlew" the same as "sudo ./gradlew" as the user jenkins?</p>

<p>The shell scripts were from git for all, so I cannot modify it by adding "sudo".</p>

<p>Adding log in my real working scenario:</p>

<pre><code>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
...
</code></pre>