apache/maven · info

Enable verbose output (-X) to see precisely which goals are

Error message

Enable verbose output (-X) to see precisely which goals are not marked as thread-safe.

What it means

Trailing hint line of BuilderCommon's non-debug thread-safety report: after listing unsafe plugins, Maven logs 'Enable verbose output (-X) to see precisely which goals are not marked as thread-safe.' and a separator line. It exists because without -X the report is aggregated at plugin level, hiding which specific goals/bindings are the problem.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java:137

                                + "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;

        List<String> unversionedPlugins = executionPlan.getMojoExecutions().stream()
                .map(MojoExecution::getPlugin)
                .filter(p -> p.getLocation("version") != null
                        && p.getLocation("version").getSource() != null
                        && defaulModelId.equals(
                                p.getLocation("version").getSource().getModelId()))
                .distinct()
                .map(Plugin::getArtifactId) // managed by us, groupId is always o.a.m.plugins
                .toList();

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Re-run the same command with -X (mvn -X -T ...) and read the 'The following goals are not marked as thread-safe' section.
  2. Upgrade/pin the plugins identified from the debug output.
  3. Alternatively inspect the plugin's goal annotations directly: mvn help:describe -Dplugin=<g:a> -Dgoal=<goal> -Ddetail shows 'Thread Safe' status.

Example fix

# before
mvn -T 4 install   # 'Enable verbose output (-X) ...'

# after
mvn -X -T 4 install 2>&1 | grep -A15 'goals are not marked as thread-safe'
Defensive patterns

Strategy: validation

Validate before calling

# guard: always make the per-goal report available in CI artifacts
mvn -T 1C package 2>&1 | tee build.log || true
grep -A30 'not marked as thread-safe' build.log > unsafe-goals.txt || true

Prevention

When it happens

Trigger: Automatically printed whenever the plugin-level non-thread-safe list is shown (parallel build, multi-module, unsafe plugins present, debug disabled).

Common situations: Developers needing per-goal detail before changing POM bindings; support tickets asking 'which goal exactly is unsafe' from plugin-level output.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/f54ee689bbd59c74. Report an issue: GitHub.