{"record":{"id":"eeb1c1efa2498acc","repo":"apache/maven","slug":"your-build-is-requesting-parallel-execution-but-t","errorCode":null,"errorMessage":"Your build is requesting parallel execution, but this project contains the following plugin(s) that have goals not marked as thread-safe to support parallel execution.\nWhile this /may/ work fine, please look for plugin updates and/or request plugins be made thread-safe.\nIf reporting an issue, report it against the plugin in question, not against Apache Maven.","messagePattern":"Your build is requesting parallel execution, but this project contains the following plugin\\(s\\) that have goals not marked as thread-safe to support parallel execution\\.\nWhile this /may/ work fine, please look for plugin updates and/or request plugins be made thread-safe\\.\nIf reporting an issue, report it against the plugin in question, not against Apache Maven\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java","lineNumber":123,"sourceCode":"                    PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,\n                    NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException,\n                    LifecycleExecutionException {\n        MavenExecutionPlan executionPlan =\n                lifeCycleExecutionPlanCalculator.calculateExecutionPlan(session, project, taskSegment.getTasks());\n\n        lifecycleDebugLogger.debugProjectPlan(project, executionPlan);\n\n        if (session.getRequest().getDegreeOfConcurrency() > 1\n                && session.getProjects().size() > 1) {\n            final Set<Plugin> unsafePlugins = executionPlan.getNonThreadSafePlugins();\n            if (!unsafePlugins.isEmpty()) {\n                for (String s : MultilineMessageHelper.format(\n                        \"Your build is requesting parallel execution, but this project contains the following \"\n                                + \"plugin(s) that have goals not marked as thread-safe to support parallel execution.\",\n                        \"While this /may/ work fine, please look for plugin updates and/or \"\n                                + \"request plugins be made thread-safe.\",\n                        \"If reporting an issue, report it against the plugin in question, not against Apache Maven.\")) {\n                    logger.warn(s);\n                }\n                if (logger.isDebugEnabled()) {\n                    final Set<MojoDescriptor> unsafeGoals = executionPlan.getNonThreadSafeMojos();\n                    logger.warn(\"The following goals are not marked as thread-safe in \" + project.getName() + \":\");\n                    for (MojoDescriptor unsafeGoal : unsafeGoals) {\n                        logger.warn(\"  \" + unsafeGoal.getId());\n                    }\n                } else {\n                    logger.warn(\"The following plugins are not marked as thread-safe in \" + project.getName() + \":\");\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            }","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java#L105-L141","documentation":"Before executing a project's plan, BuilderCommon checks whether the session requests parallelism (degreeOfConcurrency > 1 and more than one project) and whether the calculated execution plan contains plugins whose goals are not marked @threadSafe (executionPlan.getNonThreadSafePlugins()). If any exist, this multi-line warning is printed (via MultilineMessageHelper) followed by the plugin list — the build proceeds, but Maven disclaims responsibility for races in those goals.","triggerScenarios":"Running 'mvn -T ...' (or -Dmaven.parallel=true style session config) on a multi-module project whose plan includes at least one mojo whose descriptor lacks threadSafe=true — e.g. older maven-javadoc, maven-pmd, apt-maven-plugin, or custom mojos without @threadSafe.","commonSituations":"Teams enabling -T 1C in CI to speed up builds; upgrading Maven while keeping old plugin versions that predate thread-safety annotations; custom in-house plugins never audited for concurrency.","solutions":["Upgrade each listed plugin to a version whose goals are marked thread-safe (check its goal annotations/release notes).","If the goal is genuinely thread-safe but unannotated, ask the maintainer to add @threadSafe; for your own mojos add the annotation only after verifying statelessness.","Run the build without -T if listed plugins are known unsafe and output corruption is observed.","Use -X to see exactly which goals (not just plugins) are unmarked, then fix those bindings."],"exampleFix":"<!-- before: old javadoc plugin not thread-safe, build races under -T -->\n<plugin>\n  <groupId>org.apache.maven.plugins</groupId>\n  <artifactId>maven-javadoc-plugin</artifactId>\n  <version>2.10.4</version>\n</plugin>\n\n<!-- after: pinned thread-safe version -->\n<plugin>\n  <groupId>org.apache.maven.plugins</groupId>\n  <artifactId>maven-javadoc-plugin</artifactId>\n  <version>3.11.2</version>\n</plugin>","handlingStrategy":"validation","validationCode":"# guard: before enabling -T, check each plugin goal's Thread Safe flag\nmvn help:describe -Dplugin=org.apache.maven.plugins:maven-javadoc-plugin -Dgoal=jar -Ddetail | grep -i 'thread safe'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin all plugin versions in pluginManagement so upgrades to thread-safe releases are deliberate.","Smoke-test -T builds against -T 1 output (checksums, reproducible-build flags) before adopting.","Watch release notes of the listed plugins for '@threadSafe' support."],"tags":["maven","parallel-build","thread-safety","plugin-compatibility","lifecycle"],"backgroundTag":"maven-plugin-not-thread-safe","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}