quarkusio/quarkus · error · AppModelResolverException
Requested artifact ${appArtifact} does not match project ${g
Error message
Requested artifact ${appArtifact} does not match project ${group}:${name}:${version} What it means
ensureProjectCoords validates that the requested ArtifactCoords match the current Gradle project's group/name/version. Thrown when resolveModel is asked for a model of an artifact that is not this project.
Source
Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java:176
}
@Override
public ApplicationModel resolveManagedModel(ArtifactCoords appArtifact,
Collection<Dependency> directDeps,
Set<ArtifactKey> excludedArtifacts,
ArtifactCoords managingProject,
Set<ArtifactKey> localProjects)
throws AppModelResolverException {
return resolveModel(appArtifact);
}
protected void ensureProjectCoords(ArtifactCoords appArtifact) throws AppModelResolverException {
if (project.getName().equals(appArtifact.getArtifactId())
&& project.getGroup().toString().equals(appArtifact.getGroupId())
&& project.getVersion().toString().equals(appArtifact.getVersion())) {
return;
}
throw new AppModelResolverException(
"Requested artifact " + appArtifact + " does not match project " + project.getGroup() + ":" + project.getName()
+ ":" + project.getVersion());
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Align the requested ArtifactCoords with the project's current group:name:version (read them from the Project at call time)
- Ensure build.gradle sets group/version consistently with what the tooling passes
- If a different module's model is needed, use a resolver backed by the repository, not the project-based one
Example fix
// before
resolver.resolveModel(ArtifactCoords.of("io.acme","app","","jar","1.0.0"));
// after
ArtifactCoords mine = ArtifactCoords.of(
project.getGroup().toString(), project.getName(), "", "jar", project.getVersion().toString());
resolver.resolveModel(mine); Defensive patterns
Strategy: validation
Validate before calling
boolean matchesProject(Project p, ArtifactCoords c) {
return p.getName().equals(c.getArtifactId())
&& p.getGroup().toString().equals(c.getGroupId())
&& p.getVersion().toString().equals(c.getVersion());
} Type guard
boolean isProjectCoords(ArtifactCoords c, Project p) { return matchesProject(p, c); } Try / catch
try { model = resolver.resolveModel(coords); } catch (AppModelResolverException e) { /* coords != project group:name:version — rebuild coords from Project */ } Prevention
- Always build ArtifactCoords from the live Project values, not cached constants
- Keep build.gradle group/version in sync with tooling expectations
- Use a repository-backed resolver for non-project artifacts
When it happens
Trigger: Calling resolveModel with ArtifactCoords whose artifactId, groupId or version differ from project.getName(), project.getGroup() or project.getVersion().
Common situations: After a Gradle version bump (version property changed) while cached coordinates still reference the old version; group in build.gradle differs from the groupId baked into the calling code; requesting the model of another module.
Related errors
- Failed to collect Quarkus project information
- Failed to resolve ${appArtifact}
- No platforms detected in the project
- Failed to determine the Quarkus core version for the project
- Failed to configure ${taskPath}: sourceSet ${sourceSet} has
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/a3e3d808d80eeaab.
Report an issue: GitHub.