How to prevent gradlew from download anything?

∥☆過路亽.° 提交于 2020-08-27 06:49:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!