Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase timeout for gradle to get a maven dependency

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

like image 210
JohnTheBeloved Avatar asked May 11 '16 08:05

JohnTheBeloved


People also ask

Can Gradle use Maven dependency?

Gradle can consume dependencies available in the local Maven repository.

Is Maven faster than Gradle?

Gradle is between 7 and 85 times faster than Maven when building incremental changes; benefits increase with number of subprojects. Gradle builds are 3 to 30 times faster than Maven builds when task outputs can be resolved Gradle's build cache.

Can you mix Maven and Gradle?

Short answer: yes. There's no conflict between having two independent build scripts for the same project, one in Maven and one in Gradle.

What is Dependencymanagement in Gradle?

In most cases, a project relies on reusable functionality in the form of libraries or is broken up into individual components to compose a modularized system. Dependency management is a technique for declaring, resolving and using dependencies required by the project in an automated fashion.


1 Answers

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

like image 193
Tomas Bjerre Avatar answered Oct 14 '22 02:10

Tomas Bjerre