{"record":{"id":"93a23b611d09676e","repo":"apache/maven","slug":"the-goal-you-specified-requires-a-project-to-execu-93a23b","errorCode":null,"errorMessage":"The goal you specified requires a project to execute but there is no POM in this directory ({}). Please verify you invoked Maven from the correct directory.","messagePattern":"The goal you specified requires a project to execute but there is no POM in this directory \\((.+?)\\)\\. Please verify you invoked Maven from the correct directory\\.","errorType":"exception","errorClass":"MissingProjectException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/ConcurrentLifecycleStarter.java","lineNumber":87,"sourceCode":"            ExecutionEventCatapult eventCatapult,\n            DefaultLifecycles defaultLifeCycles,\n            BuildPlanExecutor executor,\n            LifecyclePluginResolver lifecyclePluginResolver,\n            MojoDescriptorCreator mojoDescriptorCreator) {\n        this.eventCatapult = eventCatapult;\n        this.defaultLifeCycles = defaultLifeCycles;\n        this.executor = executor;\n        this.lifecyclePluginResolver = lifecyclePluginResolver;\n        this.mojoDescriptorCreator = mojoDescriptorCreator;\n    }\n\n    @Override\n    public void execute(MavenSession session) {\n        eventCatapult.fire(ExecutionEvent.Type.SessionStarted, session, null);\n\n        try {\n            if (requiresProject(session) && projectIsNotPresent(session)) {\n                throw new MissingProjectException(\"The goal you specified requires a project to execute\"\n                        + \" but there is no POM in this directory (\" + session.getTopDirectory() + \").\"\n                        + \" Please verify you invoked Maven from the correct directory.\");\n            }\n\n            List<TaskSegment> taskSegments = calculateTaskSegments(session);\n            if (taskSegments.isEmpty()) {\n                throw new NoGoalSpecifiedException(\"No goals have been specified for this build.\"\n                        + \" You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or\"\n                        + \" <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.\"\n                        + \" Available lifecycle phases are: \" + defaultLifeCycles.getLifecyclePhaseList() + \".\");\n            }\n\n            int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();\n            if (degreeOfConcurrency > 1) {\n                logger.info(\"\");\n                logger.info(String.format(\n                        \"Using the %s implementation with a thread count of %d\",\n                        executor.getClass().getSimpleName(), degreeOfConcurrency));","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/ConcurrentLifecycleStarter.java#L69-L105","documentation":"The concurrent-build variant of the starter check: ConcurrentLifecycleStarter.execute() throws MissingProjectException when the requested tasks require a project but none is present. Same semantics as DefaultLifecycleStarter's check, reported against session.getTopDirectory(); it runs on the concurrent-execution code path.","triggerScenarios":"Executing a project-requiring build with the concurrent lifecycle starter (e.g. the experimental/concurrent builder or embedder using ConcurrentLifecycleStarter) in a directory with no pom.xml, or with the POM argument missing so requiresProject(session) && projectIsNotPresent(session) holds.","commonSituations":"CI jobs or IDE embedders enabling the concurrent implementation and running from the wrong working directory; scripts reusing Maven invocations without -f; workspaces where the POM lives in a submodule directory.","solutions":["Run Maven from the directory that contains pom.xml","Or specify the POM: mvn -f path/to/pom.xml <goals>","Verify the CI checkout actually contains the POM at the expected path before invoking","If no project is intended, use only goals marked requiresProject=false"],"exampleFix":"# before\nmvn -f missing-dir/pom.xml package   # POM absent -> MissingProjectException\n\n# after\nmvn -f /repo/module-a/pom.xml package","handlingStrategy":"validation","validationCode":"// embedders using ConcurrentLifecycleStarter: verify project presence first\nif (requiresProject(session) && !Files.exists(session.getTopDirectory().resolve(\"pom.xml\"))) {\n    throw new MissingProjectException(\"No POM in \" + session.getTopDirectory());\n}","typeGuard":null,"tryCatchPattern":"catch (MissingProjectException e) {\n    // point the session at the right top directory (or -f) and re-execute\n}","preventionTips":["Pin the working directory (or POM path) explicitly in embedded and CI builds","Validate the checkout layout before starting the session","Keep goal scripts that assume a POM out of POM-less directories"],"tags":["maven","missing-pom","concurrent-build","cli"],"backgroundTag":"no-pom-in-directory","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}