{"record":{"id":"f2fa0d6c1d1ce05c","repo":"apache/maven","slug":"the-following-plugins-are-not-marked-as-thread-saf","errorCode":null,"errorMessage":"The following plugins are not marked as thread-safe in {}:","messagePattern":"The following plugins are not marked as thread-safe in (.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java","lineNumber":132,"sourceCode":"                && 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            }\n        }\n\n        final String defaulModelId = DefaultLifecycleRegistry.DEFAULT_LIFECYCLE_MODELID;\n\n        List<String> unversionedPlugins = executionPlan.getMojoExecutions().stream()\n                .map(MojoExecution::getPlugin)\n                .filter(p -> p.getLocation(\"version\") != null\n                        && p.getLocation(\"version\").getSource() != null\n                        && defaulModelId.equals(","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java#L114-L150","documentation":"The non-debug branch of BuilderCommon's parallel-safety check: without -X, Maven lists the offending plugins (not individual goals) with 'The following plugins are not marked as thread-safe in <project>:', one plugin id per line, followed by the hint line to enable -X. It is emitted once per project in the reactor whose plan contains unannotated goals.","triggerScenarios":"Parallel session (threads > 1, >1 project) with non-thread-safe plugins in the plan and debug logging disabled — the default 'mvn -T 4 ...' invocation.","commonSituations":"Standard parallel CI builds; onboarding a legacy multi-module project onto -T 1C and discovering which plugins are unannotated.","solutions":["Upgrade or pin each listed plugin to a thread-safe release in <pluginManagement>.","Run once with -X to map plugin -> exact unsafe goals before editing the POM.","Drop -T (or scope it to safe modules) until the listed plugins are fixed.","Verify the fixed build is deterministic (same outputs with and without -T) before keeping parallelism."],"exampleFix":"<!-- before: no version pinning, default old bindings flagged under -T -->\n<build><plugins>\n  <plugin><artifactId>maven-pmd-plugin</artifactId></plugin>\n</plugins></build>\n\n<!-- after: pin thread-safe versions -->\n<build><pluginManagement><plugins>\n  <plugin><artifactId>maven-pmd-plugin</artifactId><version>3.27.0</version></plugin>\n</plugins></pluginManagement></build>","handlingStrategy":"validation","validationCode":"# guard: fail CI if any non-thread-safe plugin is listed\nmvn -T 1C -Dstyle.color=never package 2>&1 \\\n  | tee /tmp/build.log | grep -q 'not marked as thread-safe' \\\n  && { echo 'non-thread-safe plugins present'; exit 1; } || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a pinned plugin set in a corporate parent; forbid unversioned/legacy plugins via enforcer rules.","Prefer removing -T over shipping corrupted output (javadocs, reports) from unsafe goals."],"tags":["maven","parallel-build","thread-safety","plugin-management","pom"],"backgroundTag":"maven-plugin-not-thread-safe","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}