Skip to content

Commit

Permalink
[MNG-8182] Resolved errors were created based on collect exceptions (#…
Browse files Browse the repository at this point in the history
…1635)

Hence, they missed resolution errors.

---

https://issues.apache.org/jira/browse/MNG-8182
  • Loading branch information
cstamas authored Aug 9, 2024
1 parent 1daa1d5 commit 5ec1106
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.maven.RepositoryUtils;
import org.apache.maven.api.DependencyScope;
Expand Down Expand Up @@ -234,8 +236,13 @@ private DependencyResult resolveInternal(
throw new PluginResolutionException(
plugin, e.getResult().getExceptions(), logger.isDebugEnabled() ? e : null);
} catch (DependencyResolutionException e) {
throw new PluginResolutionException(
plugin, e.getResult().getCollectExceptions(), logger.isDebugEnabled() ? e : null);
List<Exception> exceptions = Stream.concat(
e.getResult().getCollectExceptions().stream(),
e.getResult().getArtifactResults().stream()
.filter(r -> !r.isResolved())
.flatMap(r -> r.getExceptions().stream()))
.collect(Collectors.toList());
throw new PluginResolutionException(plugin, exceptions, logger.isDebugEnabled() ? e : null);
}
}
}

0 comments on commit 5ec1106

Please sign in to comment.