{"record":{"id":"a6ae99953c746e3b","repo":"quarkusio/quarkus","slug":"failed-to-resolve-artifact","errorCode":null,"errorMessage":"Failed to resolve artifact ","messagePattern":"Failed to resolve artifact ","errorType":"exception","errorClass":"DeploymentInjectionException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyResolver.java","lineNumber":954,"sourceCode":"                .setManagedDependencies(effectiveConstraints)\n                .setRepositories(repos)\n                // formal root artifact\n                .setRootArtifact(new DefaultArtifact(\"io.quarkus\", \"quarkus-root-artifact\", ArtifactCoords.TYPE_JAR, \"1.0\"))\n                .setDependencies(List.of(new Dependency(artifact, JavaScopes.COMPILE, false, exclusions)));\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\n    private class ExtensionDependency {\n\n        static ExtensionDependency get(DependencyNode node) {\n            return (ExtensionDependency) node.getData().get(QUARKUS_EXTENSION_DEPENDENCY);\n        }\n\n        final ExtensionInfo info;\n        final DependencyNode runtimeNode;\n        final Collection<Exclusion> exclusions;\n        boolean conditionalDepsQueued;\n        private List<ExtensionDependency> extDeps;\n        private DependencyNode deploymentNode;\n        private boolean presentInTargetGraph;\n\n        ExtensionDependency(ExtensionInfo info, DependencyNode node, Collection<Exclusion> exclusions) {","sourceCodeStart":936,"sourceCodeEnd":972,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyResolver.java#L936-L972","documentation":"Thrown when the Maven Resolver cannot download/locate the JAR file of an artifact whose file was not already available locally. In ApplicationDependencyResolver.resolve(), if artifact.getFile() is null, an ArtifactRequest is sent to RepositorySystem.resolveArtifact(); an ArtifactResolutionException (artifact not found in local cache or remote repos) is wrapped in this DeploymentInjectionException naming the artifact.","triggerScenarios":"resolve(artifact, repos) is called for an artifact (e.g. a deployment JAR fetched during dependency injection) whose JAR file is absent from the local repository and cannot be fetched from the configured remote repositories.","commonSituations":"POM resolved (descriptor was cached) but the JAR was never downloaded and the machine is offline; repository mirrored/relocated so the JAR URL 404s; missing classifier handling; corporate mirror excluding the repository that holds the artifact; snapshot JAR purged from remote.","solutions":["Check the local repo path ~/.m2/repository/<g>/<a>/<v>/ for the JAR; delete *.lastUpdated files and retry with mvn -U.","Confirm the artifact JAR (not just POM) is published in one of the configured repositories — curl the repository URL for the artifact path.","Fix mirror/exclusion configuration in settings.xml that may be routing requests away from the hosting repository.","Run without -o (offline) so remote resolution can happen."],"exampleFix":"// before: offline flag prevents JAR download\n$ mvn quarkus:dev -o\n// after: allow remote resolution and force snapshot refresh\n$ mvn quarkus:dev -U","handlingStrategy":"retry","validationCode":"Path jar = Path.of(System.getProperty(\"user.home\"), \".m2\", \"repository\",\n    g.replace('.', '/'), a, v, a + \"-\" + v + \".jar\");\nboolean locallyAvailable = Files.exists(jar);\n// if !locallyAvailable, ensure network/repo access before invoking the build","typeGuard":null,"tryCatchPattern":"try {\n    build();\n} catch (DeploymentInjectionException e) {\n    if (e.getMessage().contains(\"Failed to resolve artifact\")) {\n        // one offline/network retry after cache cleanup\n        cleanLastUpdatedMarkers();\n        buildWithFlags(\"-U\");\n    } else throw e;\n}","preventionTips":["Don't build with -o (offline) unless artifacts are guaranteed cached.","Pre-warm CI images with the full dependency set before running Quarkus builds.","Check mirror settings aren't excluding repositories that host your artifacts.","Delete *.lastUpdated files after transient network failures."],"tags":["maven","artifact-not-found","network"],"backgroundTag":"could-not-resolve-artifact","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"}