{"record":{"id":"11501997d1f4a1f9","repo":"quarkusio/quarkus","slug":"failed-to-resolve-initial-application-dependencies","errorCode":null,"errorMessage":"Failed to resolve initial application dependencies","messagePattern":"Failed to resolve initial application dependencies","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/BootstrapAppModelFactory.java","lineNumber":363,"sourceCode":"     * @param appArtifactPath application artifact path\n     * @return resolved application model or null\n     */\n    private CurationResult createAppModelForJarOrNull(Path appArtifactPath) {\n        if (projectRoot != null\n                && (!Files.isDirectory(projectRoot) || projectRoot.getFileSystem().getClass().getName().contains(\"Zip\"))) {\n            AppModelResolver modelResolver = getAppModelResolver();\n            final ApplicationModel appModel;\n            ResolvedDependency appArtifact = this.appArtifact;\n            try {\n                if (appArtifact == null) {\n                    appArtifact = ModelUtils.resolveAppArtifact(appArtifactPath);\n                }\n                modelResolver.relink(appArtifact, appArtifactPath);\n                //we need some way to figure out dependencies here\n                appModel = modelResolver.resolveManagedModel(appArtifact, List.of(), Set.of(), managingProject,\n                        reloadableModules);\n            } catch (AppModelResolverException | IOException e) {\n                throw new RuntimeException(\"Failed to resolve initial application dependencies\", e);\n            }\n            return new CurationResult(appModel);\n        }\n        return null;\n    }\n\n    private Path resolveCachedCpPath(LocalProject project) {\n        if (test) {\n            return BootstrapUtils.getSerializedTestAppModelPath(project.getOutputDir());\n        }\n        if (devMode) {\n            return BootstrapUtils.resolveSerializedAppModelPath(project.getOutputDir());\n        }\n        return project.getOutputDir().resolve(QUARKUS).resolve(BOOTSTRAP).resolve(APP_MODEL_DAT);\n    }\n\n    public BootstrapAppModelFactory setMavenArtifactResolver(MavenArtifactResolver mavenArtifactResolver) {\n        this.mavenArtifactResolver = mavenArtifactResolver;","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/BootstrapAppModelFactory.java#L345-L381","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the appArtifactPath (relinked JAR) exists and is readable","Check the nested AppModelResolverException for the exact artifact that failed","Ensure all dependencies of the JAR are available in the local/remote repositories","Rebuild/reinstall the artifact so its pom.xml matches the JAR"],"exampleFix":"// before\nmvn package && java -jar target/app.jar // stale/missing pom beside jar\n// after\nmvn clean install && java -jar target/app.jar // pom and jar re-linked consistently","handlingStrategy":"validation","validationCode":"Path jar = Path.of(\"target/app.jar\");\nif (!Files.isReadable(jar) || !Files.exists(jar.resolveSibling(jar.getFileName() + \".pom\"))) {\n    throw new IllegalStateException(\"JAR or its pom missing: \" + jar);\n}","typeGuard":null,"tryCatchPattern":"try {\n    resolveAppModel();\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Failed to resolve initial application dependencies\")) {\n        // inspect cause: AppModelResolverException | IOException\n    }\n}","preventionTips":["Run mvn clean install so JAR and pom stay in sync","Ensure JAR dependencies are cached/resolvable before bootstrap","Never relink artifact paths manually to non-existent files"],"tags":["maven","jar","dependency-resolution"],"backgroundTag":"dependency-resolution-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}