{"record":{"id":"f7372285e3038f6f","repo":"quarkusio/quarkus","slug":"failed-to-locate-in-the-workspace","errorCode":null,"errorMessage":"Failed to locate  in the workspace","messagePattern":"Failed to locate  in the workspace","errorType":"exception","errorClass":"BootstrapMavenException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java","lineNumber":155,"sourceCode":"                while (!loadQueue.isEmpty()) {\n                    final WorkspaceModulePom module = loadQueue.removeLast();\n                    taskRunner.run(() -> loadModule(module));\n                }\n                taskRunner.waitForCompletion();\n            }\n            for (var module : knownModules.values()) {\n                if (module.isLoaded()) {\n                    module.process(loadedModelProcessor);\n                }\n            }\n        }\n\n        if (currentProject == null) {\n            log.errorf(\"Failed to locate %s among the following loaded modules:\", currentProjectPom);\n            for (Path moduleDir : knownModules.keySet()) {\n                log.error(\"- \" + moduleDir);\n            }\n            throw new BootstrapMavenException(\"Failed to locate \" + currentProjectPom + \" in the workspace\");\n        }\n        return currentProject;\n    }\n\n    private Consumer<WorkspaceModulePom> getLoadedModelProcessor(BootstrapMavenContext ctx) throws BootstrapMavenException {\n        if (ctx == null || !ctx.isEffectiveModelBuilder()) {\n            return this::processLoadedRawModel;\n        }\n\n        final ModelBuilder modelBuilder = BootstrapModelBuilderFactory.getDefaultModelBuilder();\n        final BootstrapModelResolver modelResolver = BootstrapModelResolver.newInstance(ctx, this);\n        final ModelCache modelCache = new BootstrapModelCache(modelResolver.getSession());\n        final List<Profile> profiles = ctx.getActiveSettingsProfiles();\n        final BootstrapMavenOptions cliOptions = ctx.getCliOptions();\n        final List<String> activeProfileIds = new ArrayList<>(profiles.size() + cliOptions.getActiveProfileIds().size());\n        for (Profile p : profiles) {\n            activeProfileIds.add(p.getId());\n        }","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java#L137-L173","documentation":"WorkspaceLoader builds an in-repository workspace of Maven modules and must return the LocalProject for the current project's POM. This error is thrown when, after loading all discovered workspace modules, the requested currentProjectPom is not among the known loaded modules. It indicates the target POM sits outside every module the workspace loader accepted or discovered.","triggerScenarios":"Calling WorkspaceLoader.load (via loadWorkspace) with a POM path that is not a registered module of the discovered workspace: e.g. the path is outside the workspace root, the module was skipped due to a failed effective-model resolution with warnOnFailingWsModules=true, or the module is not referenced by any parent <modules> section.","commonSituations":"Running Quarkus dev/build from a subdirectory whose POM is not in the parent aggregator's module list; a parent POM missing a <module> entry for the project; a sibling module whose POM fails to load and is silently skipped as a warning; symlinks or case-mismatched paths preventing module-dir matching.","solutions":["Add the project (or the directory passed to load) to the parent aggregator POM's <modules> list so the loader discovers it","Run the command from the workspace/aggregator root or pass the correct POM path","Check the log output 'Failed to resolve effective model for ...' — fix the failing sibling module POM or set warnOnFailingWsModules=false to surface the real error","Verify the path passed to loadWorkspace points to an existing pom.xml inside the workspace"],"exampleFix":"<!-- before: parent pom.xml -->\n<modules>\n  <module>app-a</module>\n</modules>\n<!-- after -->\n<modules>\n  <module>app-a</module>\n  <module>app-b</module>\n</modules>","handlingStrategy":"validation","validationCode":"Path pom = Path.of(\"path/to/pom.xml\");\nif (!Files.isRegularFile(pom)) throw new IllegalStateException(\"POM not found: \" + pom);\nString parentDir = pom.getParent().toString();\n// confirm the pom is reachable from the aggregator\nif (!pom.toAbsolutePath().startsWith(workspaceRoot.toAbsolutePath()))\n    throw new IllegalStateException(\"POM is outside the workspace root\");","typeGuard":null,"tryCatchPattern":"try {\n    LocalProject p = workspaceLoader.load(ctx);\n} catch (BootstrapMavenException e) {\n    log.error(\"Project not in workspace; check parent <modules>: \" + e.getMessage());\n}","preventionTips":["Keep every buildable project listed in its parent aggregator <modules>","Run dev/build from the workspace root or verify the POM path resolves inside it","Watch for 'Failed to resolve effective model' warnings that silently drop modules","Avoid symlinks/odd casing in module directories"],"tags":["maven","workspace","multi-module"],"backgroundTag":"module-not-in-maven-workspace","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"}