class DefaultMojoExecutionConfigurator implements MojoExecutionConfigurator {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    private final MessageBuilderFactory messageBuilderFactory;

    /**
     * Default ctor is used in IT and most probably some 3rd party code. For those cases, we do provide sane defaults
     * but given this is a component, injection should be used, replacing direct instantiation.
     *
     * @deprecated Do not use this ctor directly, inject this component instead.
     */
    @Deprecated
    public DefaultMojoExecutionConfigurator() {
        this.messageBuilderFactory = new DefaultMessageBuilderFactory();
    }

    @Inject
    public DefaultMojoExecutionConfigurator(MessageBuilderFactory messageBuilderFactory) {
        this.messageBuilderFactory = requireNonNull(messageBuilderFactory);
    }

    @Override
    public void configure(MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig) {<FILL_FUNCTION_BODY>}

    private Plugin findPlugin(String groupId, String artifactId, Collection<Plugin> plugins) {
        for (Plugin plugin : plugins) {
            if (artifactId.equals(plugin.getArtifactId()) && groupId.equals(plugin.getGroupId())) {
                return plugin;
            }
        }

        return null;
    }

    private PluginExecution findPluginExecution(String executionId, Collection<PluginExecution> executions) {
        if (executionId != null && !executionId.isEmpty()) {
            for (PluginExecution execution : executions) {
                if (executionId.equals(execution.getId())) {
                    return execution;
                }
            }
        }

        return null;
    }

    private void checkUnknownMojoConfigurationParameters(MojoExecution mojoExecution) {
        if (mojoExecution.getConfiguration() == null
                || mojoExecution.getConfiguration().getChildCount() == 0) {
            return;
        }

        MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();

        // in first step get parameter names of current goal
        Set<String> parametersNamesGoal = mojoDescriptor.getParameters().stream()
                .flatMap(this::getParameterNames)
                .collect(Collectors.toSet());

        Set<String> unknownParameters = getUnknownParameters(mojoExecution, parametersNamesGoal);

        if (unknownParameters.isEmpty()) {
            return;
        }

        // second step get parameter names of all plugin goals
        Set<String> parametersNamesAll = mojoDescriptor.getPluginDescriptor().getMojos().stream()
                .flatMap(m -> m.getParameters().stream())
                .flatMap(this::getParameterNames)
                .collect(Collectors.toSet());

        unknownParameters = getUnknownParameters(mojoExecution, parametersNamesAll);

        unknownParameters.forEach(name -> {
            MessageBuilder messageBuilder = messageBuilderFactory
                    .builder()
                    .warning("Parameter '")
                    .warning(name)
                    .warning("' is unknown for plugin '")
                    .warning(mojoExecution.getArtifactId())
                    .warning(":")
                    .warning(mojoExecution.getVersion())
                    .warning(":")
                    .warning(mojoExecution.getGoal());

            if (mojoExecution.getExecutionId() != null) {
                messageBuilder.warning(" (");
                messageBuilder.warning(mojoExecution.getExecutionId());
                messageBuilder.warning(")");
            }

            messageBuilder.warning("'");

            logger.warn(messageBuilder.toString());
        });
    }

    private Stream<String> getParameterNames(Parameter parameter) {
        if (parameter.getAlias() != null) {
            return Stream.of(parameter.getName(), parameter.getAlias());
        } else {
            return Stream.of(parameter.getName());
        }
    }

    private Set<String> getUnknownParameters(MojoExecution mojoExecution, Set<String> parameters) {
        return stream(mojoExecution.getConfiguration().getChildren())
                .map(Xpp3Dom::getName)
                .filter(name -> !parameters.contains(name))
                .collect(Collectors.toSet());
    }
}

        String g = mojoExecution.getPlugin().getGroupId();

        String a = mojoExecution.getPlugin().getArtifactId();

        Plugin plugin = findPlugin(g, a, project.getBuildPlugins());

        if (plugin == null && project.getPluginManagement() != null) {
            plugin = findPlugin(g, a, project.getPluginManagement().getPlugins());
        }

        if (plugin != null) {
            PluginExecution pluginExecution =
                    findPluginExecution(mojoExecution.getExecutionId(), plugin.getExecutions());

            XmlNode pomConfiguration = null;

            if (pluginExecution != null) {
                pomConfiguration = pluginExecution.getDelegate().getConfiguration();
            } else if (allowPluginLevelConfig) {
                pomConfiguration = plugin.getDelegate().getConfiguration();
            }

            XmlNode mojoConfiguration = mojoExecution.getConfiguration() != null
                    ? mojoExecution.getConfiguration().getDom()
                    : null;

            XmlNode mergedConfiguration = XmlNodeImpl.merge(mojoConfiguration, pomConfiguration);

            mojoExecution.setConfiguration(mergedConfiguration);

            checkUnknownMojoConfigurationParameters(mojoExecution);
        }
    
<no_super_class>