If gradlew fails downloading its Gradle distribution, the build has not started. A repository declaration or network code in a build task cannot configure that earlier Java request.

The Wrapper reads systemProp entries from project and user gradle.properties before downloading. For HTTPS destinations:

systemProp.https.proxyHost=203.0.113.10
systemProp.https.proxyPort=8080

Use your endpoint's host without a full proxy-URL scheme and its actual port; the HTTP proxy list offers candidates for distribution downloads permitted to use public HTTP proxies. User values override project values; command-line system properties take higher precedence. Compare the Gradle configuration sources if the IDE and terminal disagree. Choose the intended project/machine scope and keep personal proxy credentials out of committed files.

distributionUrl must remain the intended Gradle distribution source. It does not name a forward proxy. A redirect can introduce another host; keep the actual failed download URL and policy rather than changing dependency repositories.

A cached distribution can let another machine run gradlew --version without exercising this download. After bootstrap completes, plugin and dependency requests still need their own routes. Report whether the failure was distribution download before startup or repository access after Gradle began; those are different operations.

Mikanda mikatakata