Increase timeout for gradle to get a maven depende

2020-05-22 22:49发布

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

1条回答
\"骚年 ilove
2楼-- · 2020-05-22 23:36

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

You can increase the timeout with 2 properties:

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

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

查看更多
登录 后发表回答