{"record":{"id":"bc714e148370b1ba","repo":"quarkusio/quarkus","slug":"failed-to-collect-dependencies-for","errorCode":null,"errorMessage":"Failed to collect dependencies for ","messagePattern":"Failed to collect dependencies for ","errorType":"exception","errorClass":"DeploymentInjectionException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java","lineNumber":703,"sourceCode":"            }\n\n            var directDeps = DependencyUtils.mergeDependencies(List.of(), descr.getDependencies(), effectiveManagedMap,\n                    Set.of(JavaScopes.PROVIDED, JavaScopes.TEST));\n\n            request = new CollectRequest()\n                    .setDependencies(directDeps)\n                    .setManagedDependencies(effectiveManagedDeps)\n                    .setRepositories(repos);\n            if (exclusions.isEmpty()) {\n                request.setRootArtifact(artifact);\n            } else {\n                request.setRoot(new Dependency(artifact, JavaScopes.COMPILE, false, exclusions));\n            }\n        }\n        try {\n            return resolver.getSystem().collectDependencies(resolver.getSession(), request).getRoot();\n        } catch (DependencyCollectionException e) {\n            throw new DeploymentInjectionException(\"Failed to collect dependencies for \" + artifact, e);\n        }\n    }\n\n    private Artifact resolve(Artifact artifact, List<RemoteRepository> repos) {\n        if (artifact.getFile() != null) {\n            return artifact;\n        }\n        try {\n            return resolver.getSystem().resolveArtifact(resolver.getSession(),\n                    new ArtifactRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(repos))\n                    .getArtifact();\n        } catch (ArtifactResolutionException e) {\n            throw new DeploymentInjectionException(\"Failed to resolve artifact \" + artifact, e);\n        }\n    }\n","sourceCodeStart":685,"sourceCodeEnd":721,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java#L685-L721","documentation":"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.","triggerScenarios":"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.","commonSituations":"Missing transitive POM in a repository; malformed POM (invalid XML/bad inheritance); cyclic or otherwise broken dependency metadata; repository outage mid-build.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Reproduce collection outside Quarkus to catch malformed transitive POMs early:\n// mvn dependency:tree -Dverbose\nboolean treeCollectable() {\n    return runMaven(\"dependency:tree\") == 0;\n}","typeGuard":null,"tryCatchPattern":"try {\n    resolver.resolve();\n} catch (DeploymentInjectionException e) {\n    if (e.getCause() instanceof DependencyCollectionException dce) {\n        log.error(\"POM graph collection failed at: \" + dce.getResult().getRoot(), dce);\n    }\n    throw e;\n}","preventionTips":["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"],"tags":["maven","dependency-resolution","pom"],"backgroundTag":"maven-dependency-resolution-failure","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}