quarkusio/quarkus · error · GradleException
Project dependency not found for path:
Error message
Project dependency not found for path:
What it means
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.
Source
Thrown at devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/dependency/DependencyDataCollector.java:235
List<DeclaredDependency> declaredDeps = toDeclaredDependencies(effectiveModel);
return DeclaredDepsResult.resolved(declaredDeps);
} catch (UnresolvableModelException | ModelBuildingException e) {
project.getLogger().warn("Unable to resolve effective model for {}:{}:{}: {}",
moduleKey.getGroupId(), moduleKey.getArtifactId(), version, e.getMessage());
return DeclaredDepsResult.unresolved();
}
});
resultMap.put(moduleKey, result);
}
private void collectDeclaredFromNonRootProject(
Project project,
ResolvedArtifactResult artifact,
ProjectComponentIdentifier projectId,
Map<ArtifactKey, DeclaredDepsResult> resultMap) {
final Project depProject = getProject(project, projectId);
if (depProject == null) {
throw new GradleException("Project dependency not found for path: " + projectId.getProjectPath());
}
String groupId = String.valueOf(depProject.getGroup());
String artifactId = depProject.getName();
String version = String.valueOf(depProject.getVersion());
String type = resolveArtifactType(artifact);
ArtifactKey projectKey = DependencyUtils.getKey(groupId, artifactId, version, artifact.getFile(), type);
// from this code branche, depProject is never a root project, so we set collectTestScopes to false
DeclaredDepsResult result = declaredDependenciesCache.computeIfAbsent(new DeclaredDepsCacheKey(projectKey, false),
key -> DeclaredDepsResult.resolved(collectDeclaredFromProject(depProject, false)));
resultMap.put(projectKey, result);
}
private static Project getProject(Project project, ProjectComponentIdentifier projectId) {
var includedBuild = ToolingUtils.includedBuild(project, projectId.getBuild().getBuildPath());
final Project depProject;
if (includedBuild != null) {
if (includedBuild instanceof IncludedBuildInternal ib) {
depProject = ToolingUtils.includedBuildProject(ib, projectId.getProjectPath());View on GitHub (pinned to e1c734241f)
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
Example fix
// before (settings.gradle referencing a project outside the build)
include 'app'
includeBuild '../shared-ext' // project path not resolvable from root
// after
includeBuild '../shared-ext' {
dependencySubstitution { substitute module('com.example:ext') using project(':ext') }
} Defensive patterns
Strategy: validation
Validate before calling
// before collecting dependencies, confirm the project path resolves
if (project.findProject(projectId.getProjectPath()) == null) {
logger.warn("Project " + projectId.getProjectPath() + " not visible; check included builds");
} Try / catch
try {
collector.collectDeclaredDependencies(project);
} catch (GradleException e) {
if (e.getMessage().startsWith("Project dependency not found for path:")) {
// fall back to external-module handling or re-run without configuration cache
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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)).
Common situations: 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.
Related errors
- Failed to copy %s to %s
- Failed to locate io.quarkus:quarkus-core-deployment on the a
- Failed to find project for dependency:
- ${misalignmentReport}
- Failed to resolve ${appArtifact}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/562c9fbc20cf87cb.
Report an issue: GitHub.