quarkusio/quarkus · error · RuntimeException
Failed to create application model resolver for
Error message
Failed to create application model resolver for
What it means
BootstrapAppModelFactory.getAppModelResolver() wraps any failure to build the BootstrapAppModelResolver (Maven context creation, workspace resolution, etc.) in a RuntimeException prefixed 'Failed to create application model resolver for '. The original exception is attached as the cause; the message simply names the project root. This is a top-level aggregation point, so the real problem is almost always in the cause chain.
Source
Thrown at independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/BootstrapAppModelFactory.java:167
if (mavenArtifactResolver == null) {
final BootstrapMavenContext mvnCtx = createBootstrapMavenContext();
if (managingProject == null) {
managingProject = mvnCtx.getCurrentProjectArtifact(ArtifactCoords.TYPE_POM);
}
mvn = new MavenArtifactResolver(mvnCtx);
} else {
mvn = mavenArtifactResolver;
}
return bootstrapAppModelResolver = initAppModelResolver(mvn);
}
MavenArtifactResolver mvn = mavenArtifactResolver;
if (mvn == null) {
mvn = new MavenArtifactResolver(createBootstrapMavenContext());
}
return bootstrapAppModelResolver = initAppModelResolver(mvn);
} catch (Exception e) {
throw new RuntimeException("Failed to create application model resolver for " + projectRoot, e);
}
}
private BootstrapAppModelResolver initAppModelResolver(MavenArtifactResolver artifactResolver) {
var appModelResolver = new BootstrapAppModelResolver(artifactResolver)
.setTest(test)
.setDevMode(devMode);
var project = artifactResolver.getMavenContext().getCurrentProject();
if (project != null) {
final Properties modelProps = project.getEffectiveModel() == null
? project.getRawModel().getProperties()
: project.getEffectiveModel().getProperties();
appModelResolver.setLegacyModelResolver(BootstrapAppModelResolver.isLegacyModelResolver(modelProps));
}
return appModelResolver;
}
private BootstrapMavenContext createBootstrapMavenContext() throws AppModelResolverException {View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the cause chain (e.getCause()) — the prefixed message only names projectRoot, the root cause has the actionable detail
- Fix Maven configuration (settings.xml, mirrors, credentials) or run once online so artifacts populate the local repository
- Verify projectRoot points to a buildable Maven project (mvn validate succeeds there)
- Clear or repair a corrupted ~/.m2/repository entry for the failing artifact
Example fix
null
Defensive patterns
Strategy: try-catch
Validate before calling
Path root = factoryProjectRoot;
if (root == null || !Files.isDirectory(root.resolve("pom.xml").getParent())) {
throw new IllegalStateException("projectRoot is not a Maven project directory");
} Try / catch
try {
return factory.getAppModelResolver();
} catch (RuntimeException e) {
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.errorf(root, "App model resolver failed for %s", factoryProjectRoot);
throw new BootstrapException("Resolver creation failed: " + root.getMessage(), root);
} Prevention
- Always log or inspect the full cause chain — the top-level message only repeats projectRoot
- Verify Maven settings.xml and repository access before programmatic bootstrap
- Ensure projectRoot points at a project that passes 'mvn validate'
When it happens
Trigger: Calling getAppModelResolver() (directly or via curationResult()/modelResolver()) when creating the MavenArtifactResolver fails — bad ~/.m2 settings, unreachable remote repositories, corrupt local repository, invalid project at projectRoot, or initAppModelResolver throwing.
Common situations: Broken or auth-requiring settings.xml; offline environments without a populated local repo; a projectRoot that isn't a valid Maven project; version incompatibilities between bootstrap and resolver components.
Related errors
- The application module hasn't been built yet
- Failed to bootstrap the application
- Failed to initialize Quarkus Maven context
- Unable to determine groupId and artifactId of the extension
- Failed to build Quarkus application for
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/68d54ce722dc1975.
Report an issue: GitHub.