quarkusio/quarkus · error · BootstrapMavenException
Failed to resolve dependencies for ${artifact}
Error message
Failed to resolve dependencies for ${artifact} What it means
resolveDependencies(Artifact, deps, mainRepos) collects the dependency graph and then downloads the actual artifact files via Aether's resolveDependencies. A DependencyResolutionException (collection succeeded but artifact files missing/unreachable) is wrapped as 'Failed to resolve dependencies for <gav>'.
Source
Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java:265
newCollectRequest(artifact, mainRepos, exclusions).setDependencies(deps));
} catch (DependencyCollectionException e) {
throw new BootstrapMavenException("Failed to collect dependencies for " + artifact, e);
}
}
public DependencyResult resolveDependencies(Artifact artifact, List<Dependency> deps) throws BootstrapMavenException {
return resolveDependencies(artifact, deps, List.of());
}
public DependencyResult resolveDependencies(Artifact artifact, List<Dependency> deps, List<RemoteRepository> mainRepos)
throws BootstrapMavenException {
final CollectRequest request = newCollectRequest(artifact, mainRepos);
request.setDependencies(deps);
try {
return repoSystem.resolveDependencies(repoSession,
new DependencyRequest().setCollectRequest(request));
} catch (DependencyResolutionException e) {
throw new BootstrapMavenException("Failed to resolve dependencies for " + artifact, e);
}
}
public DependencyResult resolvePluginDependencies(Artifact pluginArtifact) throws BootstrapMavenException {
try {
return repoSystem.resolveDependencies(repoSession, new DependencyRequest().setCollectRequest(new CollectRequest()
.setRoot(new Dependency(pluginArtifact, null)).setRepositories(context.getRemotePluginRepositories())));
} catch (DependencyResolutionException e) {
throw new BootstrapMavenException("Failed to resolve dependencies for Maven plugin " + pluginArtifact, e);
}
}
/**
* Turns the list of dependencies into a simple dependency tree
*/
public DependencyResult toDependencyTree(List<Dependency> deps, List<RemoteRepository> mainRepos)
throws BootstrapMavenException {
DependencyResult result = new DependencyResult(View on GitHub (pinned to e1c734241f)
Solutions
- Inspect cause DependencyResolutionException.getCause() / result list for the specific artifact that failed to download
- Verify the failing artifact exists with the expected classifier/extension in configured repositories
- Fix network/proxy/mirror configuration in settings.xml
- Force refresh with -U or delete the local artifact dir and re-resolve
Example fix
// before
catch (BootstrapMavenException e) { throw e; }
// after
catch (BootstrapMavenException e) {
Throwable c = e.getCause();
if (c instanceof DependencyResolutionException dre)
dre.getResult().getArtifactResults().stream()
.filter(r -> r.getExceptions().length > 0)
.forEach(r -> log.error("Failed: " + r.getRequest().getArtifact()));
} Defensive patterns
Strategy: try-catch
Validate before calling
// collect first (cheaper) to validate the graph before file resolution
CollectResult cr = resolver.collectDependencies(artifact, deps, mainRepos, List.of());
if (cr.getRoot().getChildren().isEmpty()) log.warn("Empty dependency graph for " + artifact); Try / catch
try {
DependencyResult dr = resolver.resolveDependencies(artifact, deps);
} catch (BootstrapMavenException e) {
if (e.getCause() instanceof DependencyResolutionException dre)
for (ArtifactResult ar : dre.getResult().getArtifactResults())
if (ar.isResolved() == false || ar.getExceptions().length > 0)
log.error("Unresolved: " + ar.getRequest().getArtifact());
} Prevention
- Check network/proxy health before long resolution runs
- Refresh SNAPSHOTs deliberately (-U) and avoid depending on volatile snapshots
- Ensure classifier/extension requirements match what repos actually publish
- Retry transient network failures with backoff before failing the build
When it happens
Trigger: Calling resolveDependencies when a transitive dependency's binary JAR cannot be downloaded (missing from all repos, network failure) even though POM collection succeeded.
Common situations: JAR present in Central but POM referencing a private dependency; intermittent network during dev-mode dependency download; SNAPSHOT artifacts removed from the remote repo; wrong classifier requirements.
Related errors
- Failed to initialize Maven artifact resolver
- Failed to resolve Quarkus extension catalog
- Failed to resolve the extension catalog for stream '${stream
- Failed to resolve application model <appArtifact> dependenci
- Failed to resolve the available updates
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/1be46ed67262359c.
Report an issue: GitHub.