Does gradlew wrapper access external URLs?

$ ./gradlew wrapper --gradle-version 7.0.2



// Note on another URL I do not get 401 error, does the wrapper make any outside firewall calls, can I download and point the URL to a local address???

Exception in thread "main" Server returned HTTP response code: 401 for URL:




        at org.gradle.wrapper.Download.downloadInternal(


        at org.gradle.wrapper.Install$

        at org.gradle.wrapper.Install$

        at org.gradle.wrapper.ExclusiveFileAccessManager.access(

        at org.gradle.wrapper.Install.createDist(

        at org.gradle.wrapper.WrapperExecutor.execute(

        at org.gradle.wrapper.GradleWrapperMain.main(

I don’t think the wrapper task is accessing any external URLs, it just generates the wrapper properties file and puts the wrapper jar and start scripts from the currently used version in place.

But the gradlew call starts the wrapper and the wrapper downloads the distribution from the URL configured in the wrapper properties file. This downloaded distribution would then be used to execute the wrapper task.

Btw. please don’t use the all distribution, it is a waste of disk-space, time, and bandwidth for anyone executing the build. When using the Kotlin DSL it has no real advantage at all and when using the Groovy DSL it only has a slight advantage for modifying the build to overcome an IDE shortcoming that is worked on hopefully. So please at most use the alldistribution locally while editing the build. :slight_smile:

@Vampire thank you so much, still having the build issue and this is for just building locally. When code is committed it is out of my control Jenkins takes over along with Policy (Out of my control).

Well, if you have a paranoid IT department hindering normal working and you must not access your company artifactory to download the Gradle distribution defined in the wrapper but have to use one of the pre-installed versions you mentioned, then don’t use gradlew, but use gradle from the installed version with the right version, either by making your PATH ordered correctly or by calling it by full path.