如何防止gradlew下载任何内容? [英] How to prevent gradlew from download anything?

查看:187
本文介绍了如何防止gradlew下载任何内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在离线计算机上运行gradlew.从消息开始

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.如果有可能,请暂时在线

命令gradlew表示您正在尝试使用Gradle Wrapper.它是用于自动下载Gradle发行版的工具.

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.

要下载Gradle Wrapper,您必须使用正确的网络连接至少执行一次gradlew命令. 确保您具有正确的网络和代理设置.

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

选项2.手动下载发行版

或者,您也可以从官方网站下载发行版.然后解压缩它,将gradle添加到PATH变量,然后运行:

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

这篇关于如何防止gradlew下载任何内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆