增加gradle的超时以获得Maven依赖

增加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