{"record":{"id":"1be46ed67262359c","repo":"quarkusio/quarkus","slug":"failed-to-resolve-dependencies-for-artifact-1be46e","errorCode":null,"errorMessage":"Failed to resolve dependencies for ${artifact}","messagePattern":"Failed to resolve dependencies for (.+?)","errorType":"exception","errorClass":"BootstrapMavenException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java","lineNumber":265,"sourceCode":"                    newCollectRequest(artifact, mainRepos, exclusions).setDependencies(deps));\n        } catch (DependencyCollectionException e) {\n            throw new BootstrapMavenException(\"Failed to collect dependencies for \" + artifact, e);\n        }\n    }\n\n    public DependencyResult resolveDependencies(Artifact artifact, List<Dependency> deps) throws BootstrapMavenException {\n        return resolveDependencies(artifact, deps, List.of());\n    }\n\n    public DependencyResult resolveDependencies(Artifact artifact, List<Dependency> deps, List<RemoteRepository> mainRepos)\n            throws BootstrapMavenException {\n        final CollectRequest request = newCollectRequest(artifact, mainRepos);\n        request.setDependencies(deps);\n        try {\n            return repoSystem.resolveDependencies(repoSession,\n                    new DependencyRequest().setCollectRequest(request));\n        } catch (DependencyResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve dependencies for \" + artifact, e);\n        }\n    }\n\n    public DependencyResult resolvePluginDependencies(Artifact pluginArtifact) throws BootstrapMavenException {\n        try {\n            return repoSystem.resolveDependencies(repoSession, new DependencyRequest().setCollectRequest(new CollectRequest()\n                    .setRoot(new Dependency(pluginArtifact, null)).setRepositories(context.getRemotePluginRepositories())));\n        } catch (DependencyResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve dependencies for Maven plugin \" + pluginArtifact, e);\n        }\n    }\n\n    /**\n     * Turns the list of dependencies into a simple dependency tree\n     */\n    public DependencyResult toDependencyTree(List<Dependency> deps, List<RemoteRepository> mainRepos)\n            throws BootstrapMavenException {\n        DependencyResult result = new DependencyResult(","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java#L247-L283","documentation":"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>'.","triggerScenarios":"Calling resolveDependencies when a transitive dependency's binary JAR cannot be downloaded (missing from all repos, network failure) even though POM collection succeeded.","commonSituations":"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.","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"],"exampleFix":"// before\ncatch (BootstrapMavenException e) { throw e; }\n// after\ncatch (BootstrapMavenException e) {\n    Throwable c = e.getCause();\n    if (c instanceof DependencyResolutionException dre)\n        dre.getResult().getArtifactResults().stream()\n          .filter(r -> r.getExceptions().length > 0)\n          .forEach(r -> log.error(\"Failed: \" + r.getRequest().getArtifact()));\n}","handlingStrategy":"try-catch","validationCode":"// collect first (cheaper) to validate the graph before file resolution\nCollectResult cr = resolver.collectDependencies(artifact, deps, mainRepos, List.of());\nif (cr.getRoot().getChildren().isEmpty()) log.warn(\"Empty dependency graph for \" + artifact);","typeGuard":null,"tryCatchPattern":"try {\n    DependencyResult dr = resolver.resolveDependencies(artifact, deps);\n} catch (BootstrapMavenException e) {\n    if (e.getCause() instanceof DependencyResolutionException dre)\n        for (ArtifactResult ar : dre.getResult().getArtifactResults())\n            if (ar.isResolved() == false || ar.getExceptions().length > 0)\n                log.error(\"Unresolved: \" + ar.getRequest().getArtifact());\n}","preventionTips":["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"],"tags":["maven","dependency-download","network"],"backgroundTag":"dependency-resolution-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}