apache/maven · error · ParameterResolutionException

Unable to resolve mojo

Error message

Unable to resolve mojo

What it means

Error "Unable to resolve mojo" thrown in apache/maven.

Source

Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:320

                if (Objects.equals(mojoDescriptor.getGoal(), coord[3])) {
                    if (pluginConfiguration != null) {
                        pluginConfiguration = finalizeConfig(pluginConfiguration, mojoDescriptor);
                    }
                }
            }

            Session session = getInjector().getInstance(Session.class);
            Project project = getInjector().getInstance(Project.class);
            MojoExecution mojoExecution = getInjector().getInstance(MojoExecution.class);
            ExpressionEvaluator evaluator = new WrapEvaluator(
                    getInjector(), new PluginParameterExpressionEvaluatorV4(session, project, mojoExecution));

            EnhancedComponentConfigurator configurator = new EnhancedComponentConfigurator();
            configurator.configureComponent(
                    mojo, new XmlPlexusConfiguration(pluginConfiguration), evaluator, null, null);
            return mojo;
        } catch (Exception e) {
            throw new ParameterResolutionException("Unable to resolve mojo", e);
        }
    }

    /**
     * The @Mojo annotation is only retained in the class file, not at runtime,
     * so we need to actually read the class file with ASM to find the annotation and
     * the goal.
     */
    private static String getGoalFromMojoImplementationClass(Class<?> cl) throws IOException {
        return cl.getAnnotation(Named.class).value();
    }

    @Override
    @SuppressWarnings("checkstyle:MethodLength")
    public void beforeEach(ExtensionContext context) throws Exception {
        setContext(context);

        String pluginBasedir = MavenDIExtension.getBasedir();

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:320 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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