{"record":{"id":"89691915baf610f0","repo":"quarkusio/quarkus","slug":"failed-to-collect-dependencies-of-artifact","errorCode":null,"errorMessage":"Failed to collect dependencies of ${artifact}","messagePattern":"Failed to collect dependencies of (.+?)","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java","lineNumber":84,"sourceCode":"\n    protected abstract void processProjectState(QuarkusProject quarkusProject) throws MojoExecutionException;\n\n    protected ApplicationModel resolveApplicationModel() throws MojoExecutionException {\n        try {\n            return new BootstrapAppModelResolver(artifactResolver())\n                    .resolveModel(ArtifactCoords.pom(project.getGroupId(), project.getArtifactId(), project.getVersion()));\n        } catch (AppModelResolverException e) {\n            throw new MojoExecutionException(\"Failed to resolve the Quarkus application model for project \"\n                    + ArtifactCoords.pom(project.getGroupId(), project.getArtifactId(), project.getVersion()), e);\n        }\n    }\n\n    private Collection<Path> ensureResolvable(Artifact a) throws MojoExecutionException {\n        final DependencyNode root;\n        try {\n            root = artifactResolver().collectDependencies(a, List.of()).getRoot();\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Failed to collect dependencies of \" + a, e);\n        }\n        final List<Path> createdDirs = new ArrayList<>();\n        ensureResolvableModule(root, artifactResolver().getMavenContext().getWorkspace(), createdDirs);\n        return createdDirs;\n    }\n\n    private void ensureResolvableModule(DependencyNode node, LocalWorkspace workspace, List<Path> createdDirs)\n            throws MojoExecutionException {\n        Artifact artifact = node.getArtifact();\n        if (artifact != null) {\n            final LocalProject module = workspace.getProject(artifact.getGroupId(), artifact.getArtifactId());\n            if (module != null && !module.getRawModel().getPackaging().equals(ArtifactCoords.TYPE_POM)) {\n                final Path classesDir = module.getClassesDir();\n                if (!Files.exists(classesDir)) {\n                    Path topDirToCreate = classesDir;\n                    while (!Files.exists(topDirToCreate.getParent())) {\n                        topDirToCreate = topDirToCreate.getParent();\n                    }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java#L66-L102","documentation":"This MojoExecutionException wraps any exception thrown while collecting the Maven dependency tree of an artifact in QuarkusProjectStateMojoBase.ensureResolvable. Before processing project state, the mojo ensures the project POM artifact and its dependencies can be resolved; failure to collect that dependency graph aborts with this message. The underlying exception (repository errors, missing artifacts, malformed POMs) is attached as the cause.","triggerScenarios":"Calling ensureResolvable → artifactResolver().collectDependencies(a, List.of()) when the artifact's POM is missing/unresolvable, a dependency version doesn't exist, or repository access fails (auth, network).","commonSituations":"Project never built locally (siblings not in ~/.m2); invalid dependency version in pom.xml; VPN/private repo unreachable; snapshot artifacts purged from remote.","solutions":["Check the cause chain for the specific missing artifact and add/fix it in the pom","Run mvn install -DskipTests to populate the local repository with workspace modules","Verify network/credentials for the remote repositories (settings.xml servers/mirrors)","Use mvn -U to force re-resolution of stale/missing snapshots"],"exampleFix":"// before\nmvn quarkus:update   (fails collecting deps of com.example:app:1.0-SNAPSHOT)\n// after\nmvn install -DskipTests && mvn quarkus:update -U","handlingStrategy":"try-catch","validationCode":"// Verify the dependency tree resolves before invoking the goal:\n// mvn dependency:tree -f pom.xml  (fails fast with a clearer error)","typeGuard":null,"tryCatchPattern":"try {\n    // goal invocation\n} catch (MojoExecutionException e) {\n    if (e.getMessage().startsWith(\"Failed to collect dependencies of\")) {\n        // inspect e.getCause() for the missing artifact, fix pom or repo access\n    }\n}","preventionTips":["Validate dependency versions exist in your repositories before builds","Use mvn -U to refresh stale snapshots","Keep VPN/private-repo access configured in settings.xml","Build and install sibling modules before running tooling goals"],"tags":["maven","dependency-tree","dependency-resolution"],"backgroundTag":"dependency-collection-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"}