{"record":{"id":"ee5573c51f507a3f","repo":"apache/maven","slug":"no-goals-have-been-specified-for-this-build-you-m-ee5573","errorCode":null,"errorMessage":"No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: {}.","messagePattern":"No goals have been specified for this build\\. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>\\[:<plugin-version>\\]:<goal>\\. Available lifecycle phases are: (.+?)\\.","errorType":"exception","errorClass":"NoGoalSpecifiedException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/ConcurrentLifecycleStarter.java","lineNumber":94,"sourceCode":"        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));\n            }\n\n            ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();\n            ReactorBuildStatus reactorBuildStatus = new ReactorBuildStatus(session.getProjectDependencyGraph());\n            ReactorContext reactorContext =\n                    new ReactorContext(session.getResult(), oldContextClassLoader, reactorBuildStatus);\n            executor.execute(session, reactorContext, taskSegments);","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/ConcurrentLifecycleStarter.java#L76-L112","documentation":"ConcurrentLifecycleStarter throws NoGoalSpecifiedException when calculateTaskSegments() returns an empty list: no valid lifecycle phase or plugin goal was supplied to the (concurrent-path) build. The message enumerates all accepted phase names and the goal syntax.","triggerScenarios":"Invoking the concurrent starter with no goals (bare 'mvn'), with only options/properties, or with task strings that the task-segment calculator could not map to any phase or goal; also programmatic sessions whose task list is empty.","commonSituations":"CI scripts with an empty GOALS variable; wrapper scripts appending goals conditionally and the condition evaluating false; users expecting an implicit default goal other than the POM's <default-goal> (which, if unset, leaves nothing to run).","solutions":["Pass an explicit phase or goal: mvn verify / mvn plugin:goal","Set <default-goal> in the POM's <build> if you want bare 'mvn' to do something","Fix scripts so the goal variable cannot be empty: mvn ${GOALS:-install}"],"exampleFix":"<!-- before: bare 'mvn' with no default-goal -> NoGoalSpecifiedException -->\n\n<!-- after: pom.xml -->\n<build>\n  <default-goal>verify</default-goal>\n</build>","handlingStrategy":"validation","validationCode":"// reject empty task lists before executing the session\nif (taskSegments == null || taskSegments.isEmpty()) {\n    throw new IllegalArgumentException(\"No goals specified - pass a phase or <plugin>:<goal>\");\n}","typeGuard":null,"tryCatchPattern":"catch (NoGoalSpecifiedException e) {\n    // supply a default phase (package/verify) and retry the session\n}","preventionTips":["Default goal variables in scripts: mvn ${GOALS:-verify}","Configure <default-goal> for repos where bare 'mvn' is expected to work","Log the resolved goal list before execution in wrappers"],"tags":["maven","no-goal","concurrent-build","cli"],"backgroundTag":"no-goal-specified","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}