At work, we have Artifactory configured to act as a caching proxy for Gradle distributions downloaded by the Gradle Wrapper, to avoid network connectivity/
services.gradle.org outages from generally affecting us. However, the experience in getting this set up and retained isn't quite as smooth as it could be.
When upgrading Gradle versions, my preferred method is to upgrade Gradle on my system using Homebrew, and then execute the "wrapper" task from the new version. However, this overwrites the distributionUrl with the default. The proposed distributionRepository property would allow setting the repository to use as a command-line option ("gradle-distribution-repository") or in your build script. If not specified, it would retain the current default behavior from DistributionLocator, using either
https://services.gradle.org/distributions or
https://services.gradle.org/distributions-snapshots depending on the version.
Similarly, on some projects, I prefer using the "all" distribution rather than the "bin" distribution, to allow taking advantage of IntelliJ's enhanced tooling when sources are available. The proposed archiveClassifier property would default to "bin" to maintain the current behavior, but would be passed to DistributionLocator when generating URLs. I think it might also be useful to expose this as a command-line option, perhaps "gradle-archive-classifier".
Any thoughts on this change? If it sounds like a useful direction, I'd be happy to provide a pull request.