Skip to content

Commit be49de4

Browse files
committed
Report on resolution failures from the scanning phase
1 parent ed5202a commit be49de4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public Validated<Object> validate() {
173173

174174
public static class Accumulator {
175175
@Nullable MavenResolutionResult updatedRootMarker;
176+
@Nullable MavenDownloadingException scannerException;
176177
final Map<ResolvedGroupArtifactVersion, MavenResolutionResult> gavToOriginalMarker = new HashMap<>();
177178
final Map<ResolvedGroupArtifactVersion, MavenResolutionResult> gavToNewMarker = new HashMap<>();
178179

@@ -308,7 +309,7 @@ public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) {
308309
acc.updatedRootMarker = mrr.withPom(updatedResolvedPom);
309310
}
310311
} catch (MavenDownloadingException e) {
311-
// Version resolution failed, will be handled in visitor phase
312+
acc.scannerException = e;
312313
}
313314
}
314315
return document;
@@ -465,6 +466,9 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
465466
}
466467
return e.warn(tag);
467468
}
469+
if (acc.scannerException != null) {
470+
t = acc.scannerException.warn(t);
471+
}
468472
}
469473
}
470474
return t;

0 commit comments

Comments
 (0)