Naive use of the built-in settings sometimes results in hanging connections. It is likely some network issue outside of my control.
I would like to know how I can set a timeout and a retry for both downloading artifacts and publishing artifacts.
I have found a connection timeout and read timeout setting for HTTP wagon, but I have not found a retry option.
For publishing, I found a retry option, but no timeout setting.
Edit what I want is the equivalent of curl's --max-time, --retry and --retry-delay options for maven and gradle downloads and publishes.
However, there are times that you really do not need most of the features and functionalities it offers. Maven might be best for small projects, while Gradle is best for bigger projects. If you've been working with Maven and find that your project has outgrown it, it is possible to migrate from Maven to Gradle.
In maven, the main goal is related to the project phase. It avoids the work by tracking input and output tasks and only runs the tasks that have been changed. Therefore it gives a faster performance. It does not use the build cache; thus, its build time is slower than 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.
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.
I tried to dig into this topic as well, but did not find much. Except one thing. Since Gradle 4.3 (thanks to PR) you can put to gradle.properties
something like:
systemProp.org.gradle.internal.http.connectionTimeout=120000
systemProp.org.gradle.internal.http.socketTimeout=120000
Maybe once https://github.com/gradle/gradle/issues/4629 would be resolved, life will be much easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With