quarkusio/quarkus · error · DeploymentInjectionException
Failed to collect dependencies for
Error message
Failed to collect dependencies for
What it means
Thrown as a DeploymentInjectionException by collectDependencies when Maven Resolver's collectDependencies call fails with a DependencyCollectionException. This is the graph-construction phase: reading and merging POMs of the artifact and its transitive dependencies failed (e.g. a POM in the graph is unresolvable or malformed), as opposed to the later file-download phase.
Source
Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java:703
}
var directDeps = DependencyUtils.mergeDependencies(List.of(), descr.getDependencies(), effectiveManagedMap,
Set.of(JavaScopes.PROVIDED, JavaScopes.TEST));
request = new CollectRequest()
.setDependencies(directDeps)
.setManagedDependencies(effectiveManagedDeps)
.setRepositories(repos);
if (exclusions.isEmpty()) {
request.setRootArtifact(artifact);
} else {
request.setRoot(new Dependency(artifact, JavaScopes.COMPILE, false, exclusions));
}
}
try {
return resolver.getSystem().collectDependencies(resolver.getSession(), request).getRoot();
} catch (DependencyCollectionException e) {
throw new DeploymentInjectionException("Failed to collect dependencies for " + artifact, e);
}
}
private Artifact resolve(Artifact artifact, List<RemoteRepository> repos) {
if (artifact.getFile() != null) {
return artifact;
}
try {
return resolver.getSystem().resolveArtifact(resolver.getSession(),
new ArtifactRequest()
.setArtifact(artifact)
.setRepositories(repos))
.getArtifact();
} catch (ArtifactResolutionException e) {
throw new DeploymentInjectionException("Failed to resolve artifact " + artifact, e);
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Read the DependencyCollectionException cause for the exact artifact/POM that failed collection
- Ensure the failing POM is present: fix repository config or re-upload/deploy the artifact with its POM
- Validate the POM for syntax or parent-inheritance problems (mvn help:effective-pom)
- Clear the local repo entry for the failing artifact if it is truncated or corrupt, then retry with -U
Defensive patterns
Strategy: try-catch
Validate before calling
// Reproduce collection outside Quarkus to catch malformed transitive POMs early:
// mvn dependency:tree -Dverbose
boolean treeCollectable() {
return runMaven("dependency:tree") == 0;
} Try / catch
try {
resolver.resolve();
} catch (DeploymentInjectionException e) {
if (e.getCause() instanceof DependencyCollectionException dce) {
log.error("POM graph collection failed at: " + dce.getResult().getRoot(), dce);
}
throw e;
} Prevention
- Validate published POMs (no XML errors, resolvable parents)
- Avoid depending on broken third-party metadata; use <exclusions> for known-bad artifacts
- Keep local repo healthy; re-download on partial files
- Pin repository definitions so collection hits the right repos
When it happens
Trigger: collectDependencies(artifact, exclusions, repos) invoked for extension deployment artifacts; a transitive POM cannot be fetched (missing from repos) or a POM is invalid so the dependency graph cannot be built.
Common situations: Missing transitive POM in a repository; malformed POM (invalid XML/bad inheritance); cyclic or otherwise broken dependency metadata; repository outage mid-build.
Related errors
- Could not resolve POM for
- Unable to parse pom file: ${pom}
- Unable to update the pom.xml file
- The parent project must have a packaging type of POM. Curren
- Failed to resolve application model <appArtifact> dependenci
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/bc714e148370b1ba.
Report an issue: GitHub.