问题
I am trying to run gradlew on offline machine. It starts from message
Downloading https://services.gradle.org/distributions/gradle-2.10-all.zip
and then fails with exception.
What it wants and how to satisfy it?
回答1:
Option 1. If you have possibility go online temporary
Command gradlew
means you are trying to use Gradle Wrapper. It is a tool for automated downloading of Gradle distribution.
In order to download Gradle Wrapper you have to execute gradlew
command with a proper network connection at least once.
Make sure you have correct network and proxy settings.
./gradlew build
Only after that you can build a project offline. Example:
./gradlew build --offline
Option 2. Download distribution by hand
Or, alternatively, you could download distribution from official site. Then extract it, add gradle
to PATH
variable, and run:
gradle build --offline
来源:https://stackoverflow.com/questions/43088767/how-to-prevent-gradlew-from-download-anything