{"record":{"id":"562c9fbc20cf87cb","repo":"quarkusio/quarkus","slug":"project-dependency-not-found-for-path","errorCode":null,"errorMessage":"Project dependency not found for path: ","messagePattern":"Project dependency not found for path: ","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/dependency/DependencyDataCollector.java","lineNumber":235,"sourceCode":"                        List<DeclaredDependency> declaredDeps = toDeclaredDependencies(effectiveModel);\n                        return DeclaredDepsResult.resolved(declaredDeps);\n                    } catch (UnresolvableModelException | ModelBuildingException e) {\n                        project.getLogger().warn(\"Unable to resolve effective model for {}:{}:{}: {}\",\n                                moduleKey.getGroupId(), moduleKey.getArtifactId(), version, e.getMessage());\n                        return DeclaredDepsResult.unresolved();\n                    }\n                });\n        resultMap.put(moduleKey, result);\n    }\n\n    private void collectDeclaredFromNonRootProject(\n            Project project,\n            ResolvedArtifactResult artifact,\n            ProjectComponentIdentifier projectId,\n            Map<ArtifactKey, DeclaredDepsResult> resultMap) {\n        final Project depProject = getProject(project, projectId);\n        if (depProject == null) {\n            throw new GradleException(\"Project dependency not found for path: \" + projectId.getProjectPath());\n        }\n        String groupId = String.valueOf(depProject.getGroup());\n        String artifactId = depProject.getName();\n        String version = String.valueOf(depProject.getVersion());\n        String type = resolveArtifactType(artifact);\n        ArtifactKey projectKey = DependencyUtils.getKey(groupId, artifactId, version, artifact.getFile(), type);\n        // from this code branche, depProject is never a root project, so we set collectTestScopes to false\n        DeclaredDepsResult result = declaredDependenciesCache.computeIfAbsent(new DeclaredDepsCacheKey(projectKey, false),\n                key -> DeclaredDepsResult.resolved(collectDeclaredFromProject(depProject, false)));\n        resultMap.put(projectKey, result);\n    }\n\n    private static Project getProject(Project project, ProjectComponentIdentifier projectId) {\n        var includedBuild = ToolingUtils.includedBuild(project, projectId.getBuild().getBuildPath());\n        final Project depProject;\n        if (includedBuild != null) {\n            if (includedBuild instanceof IncludedBuildInternal ib) {\n                depProject = ToolingUtils.includedBuildProject(ib, projectId.getProjectPath());","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/dependency/DependencyDataCollector.java#L217-L253","documentation":"DependencyDataCollector.collectDeclaredFromNonRootProject maps a resolved artifact back to the Gradle project that produced it (a project dependency). It looks up the project by the ComponentIdentifier's project path via getProject(); if that lookup returns null the mapping is broken and a GradleException is thrown rather than silently dropping the dependency. This means the build graph reported a project component the tooling cannot resolve to an actual Project instance.","triggerScenarios":"Resolving declared dependencies of a non-root project while iterating resolved artifacts whose ProjectComponentIdentifier.getProjectPath() does not match any project reachable from the current project's root (e.g. project from an included build not visible to getProject(project, projectId)).","commonSituations":"Composite/included builds where the dependency-collecting project cannot see the consuming project; renamed or moved subprojects while stale configuration caches are in play; running the collector from the wrong root project.","solutions":["Re-run with a cleared configuration cache (./gradlew --no-configuration-cache or ./gradlew --stop) — stale caches are a common cause of broken project lookups","Check whether the dependency comes from an included build / composite build and that the included build is properly declared in settings.gradle","Verify the subproject path in settings.gradle matches the path reported in the error message","Simplify to a single-build reproduction; if it only fails in composite builds, restructure the included build reference","Update Quarkus Gradle plugin version — project-lookup handling for included builds has been reworked across releases"],"exampleFix":"// before (settings.gradle referencing a project outside the build)\ninclude 'app'\nincludeBuild '../shared-ext' // project path not resolvable from root\n// after\nincludeBuild '../shared-ext' {\n    dependencySubstitution { substitute module('com.example:ext') using project(':ext') }\n}","handlingStrategy":"validation","validationCode":"// before collecting dependencies, confirm the project path resolves\nif (project.findProject(projectId.getProjectPath()) == null) {\n    logger.warn(\"Project \" + projectId.getProjectPath() + \" not visible; check included builds\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    collector.collectDeclaredDependencies(project);\n} catch (GradleException e) {\n    if (e.getMessage().startsWith(\"Project dependency not found for path:\")) {\n        // fall back to external-module handling or re-run without configuration cache\n    } else throw e;\n}","preventionTips":["Declare all included builds correctly in settings.gradle","Avoid mixing composite builds with configuration cache until verified","Keep subproject include paths in sync with dependency declarations","Run ./gradlew --stop after renaming or moving subprojects"],"tags":["gradle","dependencies","composite-build"],"backgroundTag":"gradle-project-lookup-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"}