quarkusio/quarkus · error · RuntimeException

Failed to resolve initial application dependencies

Error message

Failed to resolve initial application dependencies

What it means

Thrown as a plain RuntimeException when resolving the initial dependencies of a JAR-packaged application fails. createAppModelForJarOrNull uses the app model resolver to resolve a managed model for the application artifact from its JAR path; an AppModelResolverException or IOException during that resolution is wrapped in this message.

Source

Thrown at independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/BootstrapAppModelFactory.java:363

     * @param appArtifactPath application artifact path
     * @return resolved application model or null
     */
    private CurationResult createAppModelForJarOrNull(Path appArtifactPath) {
        if (projectRoot != null
                && (!Files.isDirectory(projectRoot) || projectRoot.getFileSystem().getClass().getName().contains("Zip"))) {
            AppModelResolver modelResolver = getAppModelResolver();
            final ApplicationModel appModel;
            ResolvedDependency appArtifact = this.appArtifact;
            try {
                if (appArtifact == null) {
                    appArtifact = ModelUtils.resolveAppArtifact(appArtifactPath);
                }
                modelResolver.relink(appArtifact, appArtifactPath);
                //we need some way to figure out dependencies here
                appModel = modelResolver.resolveManagedModel(appArtifact, List.of(), Set.of(), managingProject,
                        reloadableModules);
            } catch (AppModelResolverException | IOException e) {
                throw new RuntimeException("Failed to resolve initial application dependencies", e);
            }
            return new CurationResult(appModel);
        }
        return null;
    }

    private Path resolveCachedCpPath(LocalProject project) {
        if (test) {
            return BootstrapUtils.getSerializedTestAppModelPath(project.getOutputDir());
        }
        if (devMode) {
            return BootstrapUtils.resolveSerializedAppModelPath(project.getOutputDir());
        }
        return project.getOutputDir().resolve(QUARKUS).resolve(BOOTSTRAP).resolve(APP_MODEL_DAT);
    }

    public BootstrapAppModelFactory setMavenArtifactResolver(MavenArtifactResolver mavenArtifactResolver) {
        this.mavenArtifactResolver = mavenArtifactResolver;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the appArtifactPath (relinked JAR) exists and is readable
  2. Check the nested AppModelResolverException for the exact artifact that failed
  3. Ensure all dependencies of the JAR are available in the local/remote repositories
  4. Rebuild/reinstall the artifact so its pom.xml matches the JAR

Example fix

// before
mvn package && java -jar target/app.jar // stale/missing pom beside jar
// after
mvn clean install && java -jar target/app.jar // pom and jar re-linked consistently
Defensive patterns

Strategy: validation

Validate before calling

Path jar = Path.of("target/app.jar");
if (!Files.isReadable(jar) || !Files.exists(jar.resolveSibling(jar.getFileName() + ".pom"))) {
    throw new IllegalStateException("JAR or its pom missing: " + jar);
}

Try / catch

try {
    resolveAppModel();
} catch (RuntimeException e) {
    if (e.getMessage().startsWith("Failed to resolve initial application dependencies")) {
        // inspect cause: AppModelResolverException | IOException
    }
}

Prevention

When it happens

Trigger: Bootstrapping an application that is a plain JAR (not a local Maven project) where modelResolver.resolveManagedModel(...) fails — e.g. the artifact path does not exist, the POM inside/next to the JAR cannot be read, or managed dependency resolution fails.

Common situations: Launching a thin/fat JAR whose accompanying pom is missing or stale, relinked artifact paths that no longer exist, repository access problems when the JAR's dependencies are not cached, and broken Maven metadata for a managed version.

Related errors


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