From f9e5e8e41bbca6add9ef59d6c4d48876af2a4e40 Mon Sep 17 00:00:00 2001 From: Sam Snyder Date: Thu, 25 Jan 2024 14:12:37 -0800 Subject: [PATCH] Reduce log spam from MavenPomDownloader. Only send downloadError event when all repositories have failed to be accessed. --- .../org/openrewrite/maven/internal/MavenPomDownloader.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java index 43495dca495..663a567a689 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java @@ -581,7 +581,6 @@ public Pom download(GroupArtifactVersion gav, return pom; } catch (HttpSenderResponseException e) { repositoryResponses.put(repo, e.getMessage()); - ctx.getResolutionListener().downloadError(gav, uris, (containingPom == null) ? null : containingPom.getRequested()); if (e.isClientSideException()) { //If the exception is a common, client-side exception, cache an empty result. mavenCache.putPom(resolvedGav, null); @@ -595,7 +594,7 @@ public Pom download(GroupArtifactVersion gav, repositoryResponses.put(repo, "Did not attempt to download because of a previous failure to retrieve from this repository."); } } - + ctx.getResolutionListener().downloadError(gav, uris, (containingPom == null) ? null : containingPom.getRequested()); sample.stop(timer.tags("outcome", "unavailable").register(Metrics.globalRegistry)); throw new MavenDownloadingException("Unable to download POM.", null, originalGav) .setRepositoryResponses(repositoryResponses);