增加gradle的超时以获得Maven依赖 [英] Increase timeout for gradle to get a maven dependency

查看:398
本文介绍了增加gradle的超时以获得Maven依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图通过grails 3.1.5 gradle依赖度Resolution 从Maven获得jar依赖项.如何增加gradle获取Maven依赖项所需的超时.当然,我已经看到依赖项需要花费较长的时间才能下载下来.但是我该如何配置gradle以便等待更长的时间以便下载依赖项

I am tring to get a jar dependency from Maven via the grails 3.1.5 gradle dependency Resolution . How do I increase timeout that gradle takes to get a maven dependency. Sure I have seen that the dependency takes quiet a longer time to be downloaded. But how can I configure gradle to wait longer in order to download the dependency

推荐答案

此功能已在Gradle中添加到此处: https://github.com/gradle/gradle/pull/3041

The feature was added in Gradle here: https://github.com/gradle/gradle/pull/3041

您可以使用2个属性来增加超时时间:

You can increase the timeout with 2 properties:

./gradlew build -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000

如Sue C所述,如果您使用gradle 4.10.2或更高版本,请使用以下

As commented by Sue C, If you are using gradle 4.10.2 or later version use following properties:

./gradlew build -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000

这篇关于增加gradle的超时以获得Maven依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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