public void callPluginGoal(String fullGoal) throws MojoFailureException, MojoExecutionException {
        String[] parts = splitGoalSpec(fullGoal);
        Plugin plugin = project.getPlugin(parts[0]);

        if (plugin == null) {
            throw new MojoFailureException("No goal " + fullGoal + " found in pom.xml");
        }

        try {
            String goal = parts[1];
            String executionId = null;
            if (goal.indexOf('#') > -1) {
                int pos = goal.indexOf('#');
                executionId = goal.substring(pos + 1);
                goal = goal.substring(0, pos);
            }

            PluginDescriptor pluginDescriptor = getPluginDescriptor(project, plugin);
            MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo(goal);
            if (mojoDescriptor == null) {
                throw new MojoExecutionException("Could not find goal '" + goal + "' in " + plugin);
            }
            MojoExecution exec = getMojoExecution(executionId, mojoDescriptor);
            pluginManager.executeMojo(session, exec);
        } catch (AbstractMojoExecutionException e) {
            throw e;
        } catch (Exception e) {
            throw new MojoExecutionException("Unable to execute mojo", e);
        }
    }
A service for executing goals on configured plugins.
<p>
Inspired by and partly reused from
https://github.com/TimMoore/mojo-executor but adapted to newer Maven versions.

@author roland
@since 01/07/15
src/main/java/io/fabric8/maven/docker/service/MojoExecutionService.java