From 87badeacebd9da11bbf463815258273e44d10292 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Tue, 21 May 2024 17:52:26 +0200 Subject: [PATCH] Add exponential backoff to Maven plugin too --- docs/src/docs/asciidoc/index.adoc | 4 ++++ .../buildtools/maven/AbstractNativeMojo.java | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc index 5a1ee3912..3465c591e 100644 --- a/docs/src/docs/asciidoc/index.adoc +++ b/docs/src/docs/asciidoc/index.adoc @@ -25,6 +25,10 @@ If you are using alternative build systems, see < metadataRepositoryConfigurations; protected GraalVMReachabilityMetadataRepository metadataRepository; @@ -207,7 +215,11 @@ private Path getRepo(Path destinationRoot) { } } - return downloadMetadataRepo(destinationRoot, targetUrl); + URL finalTargetUrl = targetUrl; + return ExponentialBackoff.get() + .withMaxRetries(metadataRepositoryMaxRetries) + .withInitialWaitPeriod(Duration.ofMillis(metadataRepositoryInitialBackoffMillis)) + .supply(() -> downloadMetadataRepo(destinationRoot, finalTargetUrl)); } }