apache/maven · error · ArtifactResolutionException
Unknown error during artifact resolution, {}, {}
Error message
Unknown error during artifact resolution, {}, {} What it means
DefaultResolutionErrorHandler.onErrors converts an ArtifactResult into legacy exceptions; after handling missing artifacts it checks result.hasExceptions() again and, if exceptions remain, wraps them in ArtifactResolutionException ('Unknown error during artifact resolution') - the code itself comments this 'should never happen'. It is a defensive catch-all for resolver failures that are neither not-found nor already-handled, and the real causes are printed in the message via result.getExceptions().
Source
Thrown at compat/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java:74
}
// Transfer Error
if (result.hasErrorArtifactExceptions()) {
throw result.getErrorArtifactExceptions().get(0);
}
if (result.hasMissingArtifacts()) {
throw new MultipleArtifactsNotFoundException(
request.getArtifact(),
toList(result.getArtifacts()),
result.getMissingArtifacts(),
request.getRemoteRepositories());
}
// this should never happen since we checked all possible error sources before but better be sure
if (result.hasExceptions()) {
throw new ArtifactResolutionException(
"Unknown error during artifact resolution, " + request + ", " + result.getExceptions(),
request.getArtifact(),
request.getRemoteRepositories());
}
}
private static <T> List<T> toList(Collection<T> items) {
return (items != null) ? new ArrayList<>(items) : null;
}
}
View on GitHub (pinned to e4093d4e12)
Solutions
- Read the exception list embedded in the message and re-run with -e -X for full stack traces - the actionable cause is in result.getExceptions()
- Fix the dominant underlying exception (usually a TransferFailedException, SSL, or disk error)
- If reproducible, audit and remove conflicting resolver/wagon extensions declared in the build or settings
- For intermittent network cases, retry the build and route repositories through one stable internal mirror
Defensive patterns
Strategy: try-catch
Try / catch
Catch ArtifactResolutionException and iterate the exception chain (getCause() and getExceptions() where available); find the first TransferFailed/IO exception and handle that root cause. Treat the 'Unknown error during artifact resolution' message as a wrapper signal, log the children verbatim.
Prevention
- Run CI builds with -e and archive the debug log for post-mortem.
- Route all repositories through a single internal mirror to reduce multi-repository fan-out failures.
- Keep resolver/wagon extensions minimal and current; remove ones you no longer need.
When it happens
Trigger: Artifact resolution completing with exception(s) that are not ArtifactNotFoundException and with no missing-artifact list: simultaneous multi-repository transport errors, a custom Wagon or resolver extension throwing, checksum-policy failures after local file cleanup, or disk-full while spooling artifacts.
Common situations: Flaky networks producing concurrent failures across several repositories; custom resolver extensions in the build misbehaving; repository managers resetting long-lived connections; disk exhaustion during download.
Related errors
- Repository list contains null entries. All repository entrie
- version can neither be null, empty nor blank
- Single version must be surrounded by []: {}
- Error updating group repository metadata
- Unable to lookup org.eclipse.aether.RepositorySystem
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/1dc2a4ae50285bc8.
Report an issue: GitHub.