{"record":{"id":"770bf31eba66d1b8","repo":"apache/maven","slug":"the-following-goals-are-not-maven-4-goals","errorCode":null,"errorMessage":"The following goals are not Maven 4 goals:","messagePattern":"The following goals are not Maven 4 goals:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java","lineNumber":329,"sourceCode":"                Set<MojoExecution> unsafeExecutions = buildPlan\n                        .allSteps()\n                        .flatMap(step -> step.mojos.values().stream().flatMap(map -> map.values().stream()))\n                        .filter(execution -> !execution.getMojoDescriptor().isV4Api())\n                        .collect(Collectors.toSet());\n                if (!unsafeExecutions.isEmpty()) {\n                    for (String s : MultilineMessageHelper.format(\"\"\"\n                                Your build is requesting concurrent execution, but this project contains the \\\n                                following plugin(s) that have goals not built with Maven 4 to support concurrent \\\n                                execution. While this /may/ work fine, please look for plugin updates and/or \\\n                                request plugins be made thread-safe. If reporting an issue, report it against the \\\n                                plugin in question, not against Apache Maven.\"\"\")) {\n                        logger.warn(s);\n                    }\n                    if (logger.isDebugEnabled()) {\n                        Set<MojoDescriptor> unsafeGoals = unsafeExecutions.stream()\n                                .map(MojoExecution::getMojoDescriptor)\n                                .collect(Collectors.toSet());\n                        logger.warn(\"The following goals are not Maven 4 goals:\");\n                        for (MojoDescriptor unsafeGoal : unsafeGoals) {\n                            logger.warn(\"  \" + unsafeGoal.getId());\n                        }\n                    } else {\n                        Set<Plugin> unsafePlugins = unsafeExecutions.stream()\n                                .map(MojoExecution::getPlugin)\n                                .collect(Collectors.toSet());\n                        logger.warn(\"The following plugins are not Maven 4 plugins:\");\n                        for (Plugin unsafePlugin : unsafePlugins) {\n                            logger.warn(\"  \" + unsafePlugin.getId());\n                        }\n                        logger.warn(\"\");\n                        logger.warn(\"Enable verbose output (-X) to see precisely which goals are not marked as\"\n                                + \" thread-safe.\");\n                    }\n                    logger.warn(MultilineMessageHelper.separatorLine());\n                }\n            }","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java#L311-L347","documentation":"Debug branch of BuildPlanExecutor.checkThreadSafety(): with -X enabled and non-v4-API executions present in a concurrent (threads > 1) build, Maven logs 'The following goals are not Maven 4 goals:' followed by each unsafe MojoDescriptor id. It names the exact goals that lack v4 API support, complementing the plugin-level list shown without debug.","triggerScenarios":"Maven 4 concurrent build (threads > 1) containing goals with isV4Api() == false, invoked with -X/debug logging so logger.isDebugEnabled() is true.","commonSituations":"Triaging a Maven 4 -T build to find exactly which goals (e.g. 'maven-compiler-plugin:3.13.0:compile') still use the v3 API before deciding what can safely run concurrently.","solutions":["Use the printed goal ids to upgrade precisely those plugins to v4-built releases.","Run without -T until every listed goal has a v4-compatible version.","For in-house plugins, port the listed mojos to the Maven 4 API (org.apache.maven.api.plugin annotations)."],"exampleFix":"# before\nmvn -T 1C package   # plugins 'not built with Maven 4'\n\n# after: get goal-level detail, then upgrade those plugins\nmvn -X -T 1C package 2>&1 | grep -A20 'not Maven 4 goals'","handlingStrategy":"validation","validationCode":"# guard: extract goal-level v4 report and gate on it\nmvn -X -T 1C package 2>&1 | grep -A50 'not Maven 4 goals' | tee v3-goals.txt\ntest ! -s v3-goals.txt","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Map each listed goal to an upstream v4 migration issue; upgrade as releases land.","Keep one -X diagnostic run per milestone instead of guessing plugin API levels."],"tags":["maven","maven-4","concurrent-build","debug-logging","plugin-api-migration"],"backgroundTag":"maven-plugin-not-thread-safe","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}