{"record":{"id":"68d54ce722dc1975","repo":"quarkusio/quarkus","slug":"failed-to-create-application-model-resolver-for","errorCode":null,"errorMessage":"Failed to create application model resolver for ","messagePattern":"Failed to create application model resolver for ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/BootstrapAppModelFactory.java","lineNumber":167,"sourceCode":"                if (mavenArtifactResolver == null) {\n                    final BootstrapMavenContext mvnCtx = createBootstrapMavenContext();\n                    if (managingProject == null) {\n                        managingProject = mvnCtx.getCurrentProjectArtifact(ArtifactCoords.TYPE_POM);\n                    }\n                    mvn = new MavenArtifactResolver(mvnCtx);\n                } else {\n                    mvn = mavenArtifactResolver;\n                }\n                return bootstrapAppModelResolver = initAppModelResolver(mvn);\n            }\n\n            MavenArtifactResolver mvn = mavenArtifactResolver;\n            if (mvn == null) {\n                mvn = new MavenArtifactResolver(createBootstrapMavenContext());\n            }\n            return bootstrapAppModelResolver = initAppModelResolver(mvn);\n        } catch (Exception e) {\n            throw new RuntimeException(\"Failed to create application model resolver for \" + projectRoot, e);\n        }\n    }\n\n    private BootstrapAppModelResolver initAppModelResolver(MavenArtifactResolver artifactResolver) {\n        var appModelResolver = new BootstrapAppModelResolver(artifactResolver)\n                .setTest(test)\n                .setDevMode(devMode);\n        var project = artifactResolver.getMavenContext().getCurrentProject();\n        if (project != null) {\n            final Properties modelProps = project.getEffectiveModel() == null\n                    ? project.getRawModel().getProperties()\n                    : project.getEffectiveModel().getProperties();\n            appModelResolver.setLegacyModelResolver(BootstrapAppModelResolver.isLegacyModelResolver(modelProps));\n        }\n        return appModelResolver;\n    }\n\n    private BootstrapMavenContext createBootstrapMavenContext() throws AppModelResolverException {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/BootstrapAppModelFactory.java#L149-L185","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"Path root = factoryProjectRoot;\nif (root == null || !Files.isDirectory(root.resolve(\"pom.xml\").getParent())) {\n    throw new IllegalStateException(\"projectRoot is not a Maven project directory\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return factory.getAppModelResolver();\n} catch (RuntimeException e) {\n    Throwable root = e;\n    while (root.getCause() != null) root = root.getCause();\n    log.errorf(root, \"App model resolver failed for %s\", factoryProjectRoot);\n    throw new BootstrapException(\"Resolver creation failed: \" + root.getMessage(), root);\n}","preventionTips":["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'"],"tags":["bootstrap","maven","workspace","build"],"backgroundTag":"app-model-resolution-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}