{"record":{"id":"888f2cbc136d3463","repo":"quarkusio/quarkus","slug":"failed-to-resolve-artifact-artifact","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/BootstrapAppModelResolver.java","lineNumber":618,"sourceCode":"            return List.of();\n        }\n        var result = new ArrayList<Exclusion>(keys.size());\n        for (ArtifactKey key : keys) {\n            result.add(new Exclusion(key.getGroupId(), key.getArtifactId(), key.getClassifier(),\n                    key.getType() == null || key.getType().isBlank() ? ArtifactCoords.TYPE_JAR : key.getType()));\n        }\n        return result;\n    }\n\n    private ArtifactResult resolve(Artifact artifact, List<RemoteRepository> aggregatedRepos)\n            throws BootstrapMavenException {\n        try {\n            return mvn.getSystem().resolveArtifact(mvn.getSession(),\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    private ArtifactDescriptorResult resolveDescriptor(Artifact artifact, List<RemoteRepository> aggregatedRepos)\n            throws BootstrapMavenException {\n        try {\n            return mvn.getSystem().readArtifactDescriptor(mvn.getSession(),\n                    new ArtifactDescriptorRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(aggregatedRepos));\n        } catch (ArtifactDescriptorException e) {\n            throw new BootstrapMavenException(\"Failed to read descriptor of \" + artifact, e);\n        }\n    }\n}\n","sourceCodeStart":600,"sourceCodeEnd":634,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java#L600-L634","documentation":"The private resolve(Artifact, List<RemoteRepository>) method asks the Maven Resolver (Aether) to resolve a single artifact file. When ArtifactResolutionException is raised (artifact not found in any repository, offline mode, corrupt local cache, etc.), it is wrapped in a BootstrapMavenException with the artifact coordinates.","triggerScenarios":"Calling resolve (used during app model building) when the Maven resolver cannot download or locate the artifact in the aggregated repositories — network failure, missing repository, wrong version, or corrupt local cache entry.","commonSituations":"Typo in groupId/artifactId/version; artifact exists only in a corporate repo that is not configured in settings.xml; running offline (-o) with the artifact not cached; 401/403 from an authenticated remote repository.","solutions":["Inspect the wrapped cause for the specific repository/status (404, offline, checksum).","Verify the artifact version exists and is spelled correctly.","Configure the required repository in settings.xml or the project POM; check credentials.","Run `mvn -U` or delete the corrupt ~/.m2/repository entry for the artifact and retry with network access."],"exampleFix":"// before\nmvn quarkus:dev -o // offline, artifact not cached\n// after\nmvn quarkus:dev -U // online, force snapshot/refresh","handlingStrategy":"try-catch","validationCode":"try {\n    mvn.getSystem().resolveArtifact(mvn.getSession(),\n        new ArtifactRequest().setArtifact(artifact).setRepositories(repos));\n} catch (ArtifactResolutionException pre) {\n    // fail early with a friendly message before invoking the resolver\n}","typeGuard":"static boolean isResolvableLocally(MavenArtifactResolver mvn, org.eclipse.aether.artifact.Artifact a) {\n    return mvn.getSession().getLocalRepositoryManager()\n        .find(mvn.getSession(), new LocalArtifactRequest()\n            .setArtifact(a).setContext(\"\")).getFile() != null;\n}","tryCatchPattern":"try {\n    model = resolver.resolveModel(coords);\n} catch (AppModelResolverException | BootstrapMavenException e) {\n    if (e.getMessage().startsWith(\"Failed to resolve artifact\")) {\n        log.error(\"Check network/repository settings; artifact: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Verify repositories and credentials in settings.xml for internal artifacts.","Avoid -o (offline) unless all artifacts are cached.","Delete ~/.m2/repository entries for artifacts that failed mid-download (look for *.lastUpdated files)."],"tags":["maven","artifact-resolution","network","repository"],"backgroundTag":"artifact-not-found","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"}