quarkusio/quarkus · error · MojoExecutionException
Failed to resolve application model <appArtifact> dependenci
Error message
Failed to resolve application model <appArtifact> dependencies
What it means
After configuring a model resolver, DependencyTreeMojo calls modelResolver.resolveModel(appArtifact) to compute the application's dependency model. Any exception during resolution (missing artifacts, bad POM, repository access problems) is wrapped in MojoExecutionException with this message and the failing artifact coordinates.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/DependencyTreeMojo.java:164
modelResolver.setTest(true);
} else if (mode.equalsIgnoreCase("dev") || mode.equalsIgnoreCase("development")) {
modelResolver.setDevMode(true);
} else if (mode.equalsIgnoreCase("prod") || mode.isEmpty()) {
// ignore, that's the default
} else {
throw new MojoExecutionException(
"Parameter 'mode' was set to '" + mode + "' while expected one of 'dev', 'test' or 'prod'");
}
}
modelResolver.setLegacyModelResolver(BootstrapAppModelResolver.isLegacyModelResolver(project.getProperties()));
modelResolver.setDepLogConfig(DependencyLoggingConfig.builder()
.setMessageConsumer(log)
.setVerbose(verbose)
.setGraph(graph)
.build());
modelResolver.resolveModel(appArtifact);
} catch (Exception e) {
throw new MojoExecutionException("Failed to resolve application model " + appArtifact + " dependencies", e);
}
}
protected MavenArtifactResolver resolver() {
return resolver == null
? resolver = workspaceProvider.createArtifactResolver(BootstrapMavenContext.config()
.setUserSettings(session.getRequest().getUserSettingsFile())
// The system needs to be initialized with the bootstrap model builder to properly interpolate system properties set on the command line
// e.g. -Dquarkus.platform.version=xxx
//.setRepositorySystem(repoSystem)
// The session should be initialized with the loaded workspace
//.setRepositorySystemSession(repoSession)
.setRemoteRepositories(repos)
// To support multi-module projects that haven't been installed
.setPreferPomsFromWorkspace(true))
: resolver;
}
}View on GitHub (pinned to e1c734241f)
Solutions
- Run `mvn install -DskipTests` on the reactor first so local modules are available in the local repository.
- Check network/proxy settings and verify repository credentials in ~/.m2/settings.xml (run with -e to see the root cause).
- Refresh/repair the local repository cache: delete the failing artifact directory under ~/.m2/repository and rebuild, or run with -U.
- Fix malformed dependency or repository declarations in the project pom.xml.
Example fix
// before (offline, module never installed) mvn quarkus:dependency-tree -o // after mvn install -DskipTests && mvn quarkus:dependency-tree
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-flight: make sure the reactor is installed and network is available mvn install -DskipTests mvn dependency:resolve -U
Try / catch
// handle the wrapped MojoExecutionException and inspect the cause
try {
// run quarkus:dependency-tree
} catch (MojoExecutionException e) {
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.error("Model resolution failed: " + root.getMessage());
} Prevention
- Run mvn install on the reactor before running the goal.
- Keep settings.xml proxy/repository credentials correct.
- Run with -U periodically to refresh stale metadata.
- Avoid referencing SNAPSHOTs that may vanish from remotes.
When it happens
Trigger: Resolving the application model for a project whose dependencies cannot be downloaded (offline mode, unreachable repository), a corrupt/invalid pom.xml, a missing local workspace module, or a snapshot artifact that no longer exists in the remote repo.
Common situations: Corporate proxy or VPN blocking Maven Central; internal repository credentials missing from settings.xml; SNAPSHOT dependency purged from remote; reactor module not built/installed before running the goal; malformed dependency declaration in pom.xml.
Related errors
- Could not resolve POM for
- Resolution of annotationProcessorPath dependencies failed: <
- Failed to initialize Quarkus Maven extension manager
- Failed to resolve the recommended Quarkus extension catalog
- Failed to resolve dependencies for ${artifact}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3795c2087ab04aac.
Report an issue: GitHub.