You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/03/01 07:43:00 UTC
[jira] [Commented] (MRESOLVER-333) Distinguish better resolver errors for artifact availability
[ https://issues.apache.org/jira/browse/MRESOLVER-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17694901#comment-17694901 ]
ASF GitHub Bot commented on MRESOLVER-333:
------------------------------------------
cstamas commented on code in PR #261:
URL: https://github.com/apache/maven-resolver/pull/261#discussion_r1121282495
##########
maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java:
##########
@@ -96,21 +97,28 @@ private static String getMessage(List<? extends ArtifactResult> results) {
for (ArtifactResult result : results) {
if (!result.isResolved()) {
unresolved++;
-
buffer.append(sep);
buffer.append(result.getRequest().getArtifact());
+ LocalArtifactResult localResult = result.getLocalArtifactResult();
+ if (localResult != null) {
+ buffer.append(" (");
+ if (localResult.getFile() != null) {
+ buffer.append("present");
+ if (!localResult.isAvailable()) {
+ buffer.append(", but unavailable");
+ }
+ } else {
+ buffer.append("absent");
+ }
+ buffer.append(")");
+ }
sep = ", ";
}
}
Throwable cause = getCause(results);
if (cause != null) {
- if (unresolved == 1) {
Review Comment:
this removal makes the unresolved unused, remove it
> Distinguish better resolver errors for artifact availability
> ------------------------------------------------------------
>
> Key: MRESOLVER-333
> URL: https://issues.apache.org/jira/browse/MRESOLVER-333
> Project: Maven Resolver
> Issue Type: Task
> Components: Resolver
> Reporter: Tamas Cservenak
> Priority: Major
> Fix For: 1.9.6
>
>
> Improve resolver emitted errors to detail more about the state (the error) how resolver came up with it. Example issues:
> * MNG-5185
> * MNG-7001
> The "artifact availability check" is widely misunderstood.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)