quarkusio/quarkus · error · RuntimeException

Failed to resolve the effective model for

Error message

Failed to resolve the effective model for 

What it means

While loading workspace modules, WorkspaceLoader resolves each raw module's effective model with the Maven model builder. If that fails, it either logs a warning (when warnOnFailingWsModules is true) and skips the module, or throws this RuntimeException wrapping the underlying cause when warnings are disabled. The cause is usually an invalid or unresolvable POM.

Source

Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java:198

            req.setPomFile(rawModule.getModel().getPomFile());
            req.setModelResolver(modelResolver);
            req.setSystemProperties(System.getProperties());
            req.setUserProperties(System.getProperties());
            req.setModelCache(modelCache);
            req.setActiveProfileIds(activeProfileIds);
            req.setInactiveProfileIds(inactiveProfileIds);
            req.setProfiles(profiles);
            req.setRawModel(rawModule.getModel());
            req.setWorkspaceModelResolver(this);
            final LocalProject project;
            try {
                project = new LocalProject(modelBuilder.build(req), workspace);
            } catch (Exception e) {
                if (warnOnFailingWsModules) {
                    log.warn("Failed to resolve effective model for " + rawModule.getModel().getPomFile(), e);
                    return;
                }
                throw new RuntimeException("Failed to resolve the effective model for " + rawModule.getModel().getPomFile(), e);
            }
            loadedModule(project);
            for (var module : project.getEffectiveModel().getModules()) {
                queueModule(project.getDir().resolve(module));
            }
        };
    }

    private void processLoadedRawModel(WorkspaceModulePom module) {
        loadedModule(new LocalProject(module.getResolvedGroupId(), module.getResolvedVersion(), module.getModel(),
                module.effectiveModel, workspace));
    }

    private void loadedModule(LocalProject project) {
        log.debugf("Loaded module from %s", project.getDir());
        if (currentProject == null && project.getDir().equals(currentProjectPom.getParent())) {
            currentProject = project;
        }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the wrapped cause 'e' in the stack trace — it names the exact POM problem (unresolvable parent, bad XML, etc.) and fix it
  2. Fix the parent POM reference or version property in the failing module's pom.xml
  3. Run 'mvn validate' on the module locally to reproduce the model-building failure outside Quarkus
  4. If you intended failures to be tolerated, enable warnOnFailingWsModules in BootstrapMavenContext

Example fix

<!-- before -->
<parent>
  <groupId>com.acme</groupId>
  <artifactId>parent</artifactId>
  <version>1.1-SNAPSHOT</version>
</parent>
<!-- after: parent actually exists at 1.0 -->
<parent>
  <groupId>com.acme</groupId>
  <artifactId>parent</artifactId>
  <version>1.0</version>
</parent>
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate POMs build before workspace load
Process p = new ProcessBuilder("mvn", "-q", "validate").directory(projectRoot.toFile()).inheritIO().start();
if (p.waitFor() != 0) throw new IllegalStateException("POM model invalid; fix before workspace load");

Try / catch

try {
    loader.load(ctx);
} catch (RuntimeException e) {
    Throwable cause = e.getCause();
    log.error("Effective model failure for a workspace POM: " + (cause != null ? cause.getMessage() : e.getMessage()));
}

Prevention

When it happens

Trigger: Queueing a workspace module whose POM cannot be built into an effective model: malformed XML, unresolvable parent POM, invalid inheritance/version placeholders, or a model-builder exception — thrown when ctx.warnOnFailingWsModules is false; skipped with a warning when true.

Common situations: A typo in a module pom.xml; a parent version that no longer resolves; a CI property like ${revision} misconfigured; upgrading Maven/model builder and POMs relying on deprecated interpolation.

Related errors


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