apache/maven · warning
The following goals are not marked as thread-safe in {}:
Error message
The following goals are not marked as thread-safe in {}: What it means
The debug-enabled branch of BuilderCommon's thread-safety check: when -X is active and the plan contains non-thread-safe plugins, Maven logs 'The following goals are not marked as thread-safe in <project>:' followed by one line per unsafe MojoDescriptor id (executionPlan.getNonThreadSafeMojos()). It is the precise, goal-level version of the plugin-level list shown without -X.
Source
Thrown at impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java:127
lifeCycleExecutionPlanCalculator.calculateExecutionPlan(session, project, taskSegment.getTasks());
lifecycleDebugLogger.debugProjectPlan(project, executionPlan);
if (session.getRequest().getDegreeOfConcurrency() > 1
&& session.getProjects().size() > 1) {
final Set<Plugin> unsafePlugins = executionPlan.getNonThreadSafePlugins();
if (!unsafePlugins.isEmpty()) {
for (String s : MultilineMessageHelper.format(
"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.",
"While this /may/ work fine, please look for plugin updates and/or "
+ "request plugins be made thread-safe.",
"If reporting an issue, report it against the plugin in question, not against Apache Maven.")) {
logger.warn(s);
}
if (logger.isDebugEnabled()) {
final Set<MojoDescriptor> unsafeGoals = executionPlan.getNonThreadSafeMojos();
logger.warn("The following goals are not marked as thread-safe in " + project.getName() + ":");
for (MojoDescriptor unsafeGoal : unsafeGoals) {
logger.warn(" " + unsafeGoal.getId());
}
} else {
logger.warn("The following plugins are not marked as thread-safe in " + project.getName() + ":");
for (Plugin unsafePlugin : unsafePlugins) {
logger.warn(" " + unsafePlugin.getId());
}
logger.warn("");
logger.warn("Enable verbose output (-X) to see precisely which goals are not marked as"
+ " thread-safe.");
}
logger.warn(MultilineMessageHelper.separatorLine());
}
}
final String defaulModelId = DefaultLifecycleRegistry.DEFAULT_LIFECYCLE_MODELID;
View on GitHub (pinned to e4093d4e12)
Solutions
- Use the listed goal ids to pin/upgrade exactly those plugin versions in pluginManagement.
- Re-run without -T for the modules that execute those goals if they cannot be upgraded.
- Bind those goals to a forked or sequential part of the build so they never run concurrently.
- For your own plugin, add org.apache.maven.plugins.annotations.Mojo(threadSafe = true) once verified.
Example fix
# before mvn -T 1C package # warn: plugins not marked thread-safe # after: identify exact goals, then pin fixed versions mvn -X -T 1C package | grep -A20 'not marked as thread-safe' # -> maven-pmd-plugin:3.13.0:pmd => upgrade to 3.27.0 in pluginManagement
Defensive patterns
Strategy: validation
Validate before calling
# guard: capture goal-level report once, gate CI on it being empty mvn -X -T 1C package 2>&1 | grep -A50 'goals are not marked as thread-safe' | tee /tmp/unsafe.txt test ! -s /tmp/unsafe.txt
Prevention
- Run one -X pass when adding -T to a project; record the exact unsafe goals.
- Fix or re-bind only those goals rather than disabling parallelism project-wide.
When it happens
Trigger: Same parallel session conditions as the parent warning (degreeOfConcurrency > 1, multiple projects, non-empty getNonThreadSafePlugins()) plus logger.isDebugEnabled() — i.e. Maven invoked with -X or -e/-debug output.
Common situations: Diagnosing which exact goals break a -T build after seeing the plugin-level warning; CI debug logs showing goal ids like 'maven-javadoc-plugin:3.x:jar (attach-javadocs)'.
Related errors
- Your build is requesting parallel execution, but this projec
- The following plugins are not marked as thread-safe in {}:
- Enable verbose output (-X) to see precisely which goals are
- Invalid threads core multiplier value: '{}'. Value must be p
- Invalid threads value: '{}'. Value must be positive.
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/47b17474c2308a00.
Report an issue: GitHub.