32

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

030
  • 10,842
  • 12
  • 78
  • 123
JohnTheBeloved
  • 2,323
  • 3
  • 19
  • 24

1 Answers1

40

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

Yasitha Waduge
  • 13,180
  • 5
  • 35
  • 42
Tomas Bjerre
  • 3,270
  • 22
  • 27
  • 6
    As of gradle version 4.10.2 these properties changed their names to `org.gradle.internal.http.connectionTimeout` and `org.gradle.internal.http.socketTimeout` https://github.com/gradle/gradle/commit/f2fd5f4209735e34905c321c43309d03850cf98a#diff-74c3ade11e986620589ba9ac0d78dcef – Sue C Sep 25 '18 at 15:28
  • I believe Sue C's comment applies not only to 4.10.2+, but to 4.3.1+ (see https://github.com/gradle/gradle/pull/3371). I know this is true for 4.10, which is what I'm currently using. – Mark Oct 03 '18 at 18:36
  • 1
    It works for me: `-Phttp.socketTimeout=200000 -Phttp.connectionTimeout=200000` with Gradle 4.8.1 version – Diego Cortes Jul 16 '19 at 18:49