quarkusio/quarkus · error · MojoExecutionException

Failed to resolve the Quarkus application model for project

Error message

Failed to resolve the Quarkus application model for project ${coords}

What it means

This MojoExecutionException wraps an AppModelResolverException raised while resolving the Quarkus application model for the current project's POM coordinates in QuarkusProjectStateMojoBase.resolveApplicationModel. BootstrapAppModelResolver fetches the project POM and its dependency graph to build the app model; any Maven artifact resolution failure surfaces here. The original exception is preserved as the cause.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java:74

        final Collection<Path> createdDirs = ensureResolvable(new DefaultArtifact(project.getGroupId(),
                project.getArtifactId(), ArtifactCoords.TYPE_POM, project.getVersion()));
        try {
            processProjectState(quarkusProject);
        } finally {
            for (Path p : createdDirs) {
                IoUtils.recursiveDelete(p);
            }
        }
    }

    protected abstract void processProjectState(QuarkusProject quarkusProject) throws MojoExecutionException;

    protected ApplicationModel resolveApplicationModel() throws MojoExecutionException {
        try {
            return new BootstrapAppModelResolver(artifactResolver())
                    .resolveModel(ArtifactCoords.pom(project.getGroupId(), project.getArtifactId(), project.getVersion()));
        } catch (AppModelResolverException e) {
            throw new MojoExecutionException("Failed to resolve the Quarkus application model for project "
                    + ArtifactCoords.pom(project.getGroupId(), project.getArtifactId(), project.getVersion()), e);
        }
    }

    private Collection<Path> ensureResolvable(Artifact a) throws MojoExecutionException {
        final DependencyNode root;
        try {
            root = artifactResolver().collectDependencies(a, List.of()).getRoot();
        } catch (Exception e) {
            throw new MojoExecutionException("Failed to collect dependencies of " + a, e);
        }
        final List<Path> createdDirs = new ArrayList<>();
        ensureResolvableModule(root, artifactResolver().getMavenContext().getWorkspace(), createdDirs);
        return createdDirs;
    }

    private void ensureResolvableModule(DependencyNode node, LocalWorkspace workspace, List<Path> createdDirs)
            throws MojoExecutionException {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the caused-by AppModelResolverException to identify the unresolvable artifact and fix its declaration
  2. Run mvn install -DskipTests on the multi-module build so sibling module POMs exist in the local repo
  3. Delete the corrupt artifact directory under ~/.m2/repository and re-run to re-download
  4. Verify repository credentials/mirrors in settings.xml for private artifacts

Example fix

// before
mvn quarkus:update  (fails: cannot resolve com.example:parent:1.0)
// after
mvn install -DskipTests -f parent-pom/ && mvn quarkus:update
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-resolve the project POM to confirm it is available:
// mvn dependency:resolve -f pom.xml   (run before quarkus:update/info)

Try / catch

try {
    ApplicationModel model = resolver.resolveModel(coords);
} catch (AppModelResolverException e) {
    // log the unresolvable artifact from the cause chain, run mvn install -DskipTests, retry
}

Prevention

When it happens

Trigger: Calling resolveApplicationModel when the project POM or its dependencies cannot be resolved from local/remote repositories — missing parent POM, unresolvable snapshot, corrupted local repo cache, or unmet dependency versions.

Common situations: Never-run multi-module build where sibling modules aren't installed; corrupted ~/.m2 repository entries; missing private repository credentials; broken parent BOM version in pom.xml.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/6804341dc9c2a201. Report an issue: GitHub.