{"record":{"id":"cf61aca8b096149f","repo":"quarkusio/quarkus","slug":"failed-to-resolve-artifact-artifact-cf61ac","errorCode":null,"errorMessage":"Failed to resolve artifact ${artifact}","messagePattern":"Failed to resolve artifact (.+?)","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":168,"sourceCode":"    }\n\n    public ArtifactResult resolve(Artifact artifact) throws BootstrapMavenException {\n        return resolveInternal(artifact, remoteRepos);\n    }\n\n    public ArtifactResult resolve(Artifact artifact, List<RemoteRepository> mainRepos) throws BootstrapMavenException {\n        return resolveInternal(artifact, aggregateRepositories(mainRepos, remoteRepos));\n    }\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 {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java#L150-L186","documentation":"MavenArtifactResolver.resolve(Artifact) resolves a single Maven artifact through the Eclipse Aether RepositorySystem (resolveArtifact) against the aggregated remote repositories. If Aether throws ArtifactResolutionException (artifact not found in any repo, repo unreachable, checksum failure), it is wrapped in BootstrapMavenException 'Failed to resolve artifact <gav>'.","triggerScenarios":"Calling MavenArtifactResolver.resolve(Artifact) for a GAV that does not exist in local or any configured remote repository; remote repositories unreachable; wrong classifier/extension in the artifact coordinates.","commonSituations":"Typo in artifact coordinates or version not published (e.g. using a version only in a repo not configured); corporate proxy/firewall blocking repo.apache.org or Maven Central; missing repository declarations for a third-party artifact; SNAPSHOT that was purged.","solutions":["Read the wrapped ArtifactResolutionException cause for the missing artifact and attempted repositories","Verify the coordinates (groupId:artifactId:version:classifier:extension) exist on Maven Central or the configured repos","Add the required <repository> to settings.xml or the project so the artifact's host repo is aggregated","Check network/proxy settings (settings.xml proxies, HTTPs, firewall) if repos are unreachable"],"exampleFix":"// before\nresolver.resolve(new DefaultArtifact(\"com.example\", \"foo\", \"jar\", \"1.2.3\")); // wrong signature order\n// after\nresolver.resolve(new DefaultArtifact(\"com.example\", \"foo\", null, \"jar\", \"1.2.3\")); // classifier=null","handlingStrategy":"try-catch","validationCode":"// verify coordinates exist before calling\nVersionRangeResult r = resolver.resolveVersionRange(\n    new DefaultArtifact(g, a, null, ext, \"[0,)\"));\nif (r.getHighestVersion() == null) throw new IllegalArgumentException(\"Unknown artifact \" + g + \":\" + a);","typeGuard":null,"tryCatchPattern":"try {\n    ArtifactResult res = resolver.resolve(artifact);\n} catch (BootstrapMavenException e) {\n    if (e.getCause() instanceof ArtifactResolutionException are) {\n        for (Exception ex : are.getResults().get(0).getExceptions())\n            log.error(\"Repo failure: \" + ex.getMessage());\n    }\n    throw new IllegalStateException(\"Cannot resolve \" + artifact, e);\n}","preventionTips":["Validate GAV coordinates against search.maven.org before resolving","Configure all required repositories (including internal Nexus/Artifactory) up front","Set proper proxy settings in settings.xml for corporate networks","Prefer explicit released versions over LATEST/moving versions"],"tags":["maven","artifact-resolution","network"],"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"}