{"record":{"id":"42cbea2e08db3626","repo":"quarkusio/quarkus","slug":"failed-to-resolve-artifacts","errorCode":null,"errorMessage":"Failed to resolve artifacts","messagePattern":"Failed to resolve artifacts","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":176,"sourceCode":"    }\n\n    private ArtifactResult resolveInternal(Artifact artifact, List<RemoteRepository> aggregatedRepos)\n            throws BootstrapMavenException {\n        try {\n            return repoSystem.resolveArtifact(repoSession,\n                    new ArtifactRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(aggregatedRepos));\n        } catch (ArtifactResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve artifact \" + artifact, e);\n        }\n    }\n\n    public List<ArtifactResult> resolve(List<ArtifactRequest> artifacts) throws BootstrapMavenException {\n        try {\n            return repoSystem.resolveArtifacts(repoSession, artifacts);\n        } catch (ArtifactResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve artifacts\", e);\n        }\n    }\n\n    public ArtifactDescriptorResult resolveDescriptor(final Artifact artifact)\n            throws BootstrapMavenException {\n        return resolveDescriptorInternal(artifact, remoteRepos);\n    }\n\n    public ArtifactDescriptorResult resolveDescriptor(final Artifact artifact, List<RemoteRepository> mainRepos)\n            throws BootstrapMavenException {\n        return resolveDescriptorInternal(artifact, aggregateRepositories(mainRepos, remoteRepos));\n    }\n\n    private ArtifactDescriptorResult resolveDescriptorInternal(final Artifact artifact, List<RemoteRepository> aggregatedRepos)\n            throws BootstrapMavenException {\n        try {\n            return repoSystem.readArtifactDescriptor(repoSession,\n                    new ArtifactDescriptorRequest()","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java#L158-L194","documentation":"MavenArtifactResolver.resolve(List<ArtifactRequest>) resolves multiple artifacts in one Aether resolveArtifacts call. If any request in the batch fails, Aether throws ArtifactResolutionException and this wrapper 'Failed to resolve artifacts' is thrown; the cause's getResults() identifies which specific artifacts failed.","triggerScenarios":"Calling resolve(List<ArtifactRequest>) where at least one requested artifact cannot be resolved from local repo or the aggregated remote repositories (missing artifact, offline, broken repo).","commonSituations":"Batch dependency downloads in tooling (Quarkus code generation, dev mode class loading) where a single bad version in a list fails the whole batch; mixed valid/invalid coordinates; one unreachable repository slowing/failing the batch.","solutions":["Inspect the cause (ArtifactResolutionException.getResults()) to find the failing artifact(s) and fix those coordinates","Run artifacts through resolve one-by-one to isolate the offender","Ensure every needed repository is configured for the session (bootstrap Maven context repos)","Retry after fixing network/proxy or after the artifact is published"],"exampleFix":"// before\ncatch (BootstrapMavenException e) { log.error(e.getMessage()); }\n// after\ncatch (BootstrapMavenException e) {\n    if (e.getCause() instanceof ArtifactResolutionException are) {\n        are.getResults().stream().filter(r -> !r.isResolved())\n           .forEach(r -> log.error(\"Missing: \" + r.getRequest().getArtifact()));\n    }\n}","handlingStrategy":"try-catch","validationCode":"for (ArtifactRequest req : requests) {\n    // cheap existence pre-check in local repo\n    if (!localArtifactExists(req.getArtifact())) pending.add(req);\n}\nif (pending.isEmpty()) return; // skip batch entirely","typeGuard":null,"tryCatchPattern":"try {\n    List<ArtifactResult> results = resolver.resolve(requests);\n} catch (BootstrapMavenException e) {\n    if (e.getCause() instanceof ArtifactResolutionException are)\n        are.getResults().stream()\n           .filter(r -> !r.isResolved())\n           .forEach(r -> reportMissing(r.getRequest().getArtifact()));\n}","preventionTips":["Split large batches so one bad coordinate doesn't fail everything (retry individually on failure)","Keep a curated, verified list of artifact coordinates","Log artifact-request contents before batch resolution for diagnosis","Ensure session repositories cover every vendor of the requested artifacts"],"tags":["maven","artifact-resolution","batch"],"backgroundTag":"artifact-resolution-failed","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"}