{"record":{"id":"5ded629747f3fe38","repo":"quarkusio/quarkus","slug":"the-application-module-hasn-t-been-built-yet","errorCode":null,"errorMessage":"The application module hasn't been built yet","messagePattern":"The application module hasn't been built yet","errorType":"exception","errorClass":"AppModelResolverException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java","lineNumber":256,"sourceCode":"            throws AppModelResolverException {\n        return doResolveModel(appArtifact, toAetherDeps(directDeps),\n                excludedArtifacts, managingProject,\n                reloadableModules);\n    }\n\n    /**\n     * Resolve application mode for the main application module that might not have a POM file on disk.\n     *\n     * @param module main application module\n     * @return resolved application model\n     * @throws AppModelResolverException in case application model could not be resolved\n     */\n    public ApplicationModel resolveModel(WorkspaceModule module)\n            throws AppModelResolverException {\n        final PathList.Builder resolvedPaths = PathList.builder();\n        if (module.hasMainSources()) {\n            if (!module.getMainSources().isOutputAvailable()) {\n                throw new AppModelResolverException(\"The application module hasn't been built yet\");\n            }\n            module.getMainSources().getSourceDirs().forEach(s -> {\n                if (!resolvedPaths.contains(s.getOutputDir())) {\n                    resolvedPaths.add(s.getOutputDir());\n                }\n            });\n            module.getMainSources().getResourceDirs().forEach(s -> {\n                if (!resolvedPaths.contains(s.getOutputDir())) {\n                    resolvedPaths.add(s.getOutputDir());\n                }\n            });\n        }\n        final Artifact mainArtifact = new DefaultArtifact(module.getId().getGroupId(), module.getId().getArtifactId(), null,\n                ArtifactCoords.TYPE_JAR,\n                module.getId().getVersion());\n        final ResolvedDependencyBuilder mainDep = ResolvedDependencyBuilder.newInstance()\n                .setGroupId(mainArtifact.getGroupId())\n                .setArtifactId(mainArtifact.getArtifactId())","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java#L238-L274","documentation":"BootstrapAppModelResolver.resolveModel(WorkspaceModule) builds an application model using the module's compiled output. If the main sources exist but their output directory is not available (i.e. the project has never been compiled), the resolver throws this AppModelResolverException instead of proceeding with empty paths.","triggerScenarios":"Calling resolveModel(module) on a WorkspaceModule whose getMainSources().isOutputAvailable() returns false — i.e. the module has main sources declared but no compiled classes in target/classes (or equivalent output dir).","commonSituations":"Running a Quarkus dev-mode or tooling bootstrap against a freshly cloned project before `mvn compile`; cleaning the project and launching the app without recompiling; IDE-launched runs where incremental compilation has not produced output yet.","solutions":["Compile the application module first, e.g. `mvn compile` (or the equivalent Gradle `compileJava`), then retry.","If invoking programmatically, ensure the workspace module's sources output directory (target/classes) exists and contains classes before calling resolveModel.","Check for build configuration issues (wrong outputDirectory, custom build dir) that make the resolver look at an empty/nonexistent output location."],"exampleFix":"// before\nresolver.resolveModel(appModule); // throws if target/classes missing\n// after\nnew MavenProcessBuilder(\"mvn\", \"compile\").run(); // build first\nresolver.resolveModel(appModule);","handlingStrategy":"validation","validationCode":"if (module.hasMainSources() && !module.getMainSources().isOutputAvailable()) {\n    throw new IllegalStateException(\"Run 'mvn compile' before resolving model for \" + module.getId());\n}\nresolver.resolveModel(module);","typeGuard":"static boolean isBuilt(io.quarkus.workspace.WorkspaceModule m) {\n    return !m.hasMainSources() || m.getMainSources().isOutputAvailable();\n}","tryCatchPattern":"try {\n    model = resolver.resolveModel(module);\n} catch (AppModelResolverException e) {\n    if (e.getMessage().contains(\"hasn't been built yet\")) {\n        throw new IllegalStateException(\"Compile the project first: mvn compile\", e);\n    }\n    throw e;\n}","preventionTips":["Always compile the project (mvn compile / gradle compileJava) before launching Quarkus tooling or dev mode.","In CI, order the build: compile -> bootstrap resolution -> run.","Watch for IDE clean actions that wipe target/classes without recompiling."],"tags":["maven","build","bootstrap","workspace"],"backgroundTag":"module-not-built","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-15T02:17:10.978Z"}