Skip to content

Apache Lucene open-source search software

build: configure 3 retries for all gradle Download tasks (#14653)

Robert Muir8fc12537b48c
diff --git a/build.gradle b/build.gradle
index 9a1f596b09c..96dc4e4a7b3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -200,6 +200,7 @@ apply from: file('gradle/documentation/markdown.gradle')
apply from: file('gradle/documentation/render-javadoc.gradle')
apply from: file('gradle/documentation/check-broken-links.gradle')
+apply from: file('gradle/hacks/downloader-retries.gradle')
apply from: file('gradle/hacks/gradle-archives.gradle')
apply from: file('gradle/hacks/wipe-temp.gradle')
apply from: file('gradle/hacks/hashmapAssertions.gradle')
diff --git a/gradle/hacks/downloader-retries.gradle b/gradle/hacks/downloader-retries.gradle
new file mode 100644
index 00000000000..84876d287c5
--- /dev/null
+++ b/gradle/hacks/downloader-retries.gradle
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects {project ->
+ // Limit configuration to just those projects that actually have the plugin enabled.
+ plugins.matching { Plugin plugin ->
+ return plugin.class.name == "de.undercouch.gradle.tasks.download.DownloadTaskPlugin"
+ }.configureEach {
+ project.tasks.withType(Download).configureEach {
+ it.retries 3
+ }
+ }
+}
\ No newline at end of file