class DefaultLifecycleExecutor implements LifecycleExecutor {

    private final LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
    private final DefaultLifecycles defaultLifeCycles;
    private final LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator;
    private final LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator;
    private final MojoExecutor mojoExecutor;
    private final LifecycleStarter lifecycleStarter;

    @Inject
    public DefaultLifecycleExecutor(
            LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer,
            DefaultLifecycles defaultLifeCycles,
            LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator,
            LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator,
            MojoExecutor mojoExecutor,
            LifecycleStarter lifecycleStarter) {
        this.lifeCyclePluginAnalyzer = lifeCyclePluginAnalyzer;
        this.defaultLifeCycles = defaultLifeCycles;
        this.lifecycleTaskSegmentCalculator = lifecycleTaskSegmentCalculator;
        this.lifecycleExecutionPlanCalculator = lifecycleExecutionPlanCalculator;
        this.mojoExecutor = mojoExecutor;
        this.lifecycleStarter = lifecycleStarter;
    }

    public void execute(MavenSession session) {
        lifecycleStarter.execute(session);
    }

    // These methods deal with construction intact Plugin object that look like they come from a standard
    // <plugin/> block in a Maven POM. We have to do some wiggling to pull the sources of information
    // together and this really shows the problem of constructing a sensible default configuration but
    // it's all encapsulated here so it appears normalized to the POM builder.

    // We are going to take the project packaging and find all plugin in the default lifecycle and create
    // fully populated Plugin objects, including executions with goals and default configuration taken
    // from the plugin.xml inside a plugin.
    //
    // TODO This whole method could probably removed by injecting lifeCyclePluginAnalyzer straight into client site.
    // TODO But for some reason the whole plexus appcontext refuses to start when I try this.

    public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles(String packaging) {
        return lifeCyclePluginAnalyzer.getPluginsBoundByDefaultToAllLifecycles(packaging);
    }

    // USED BY MAVEN HELP PLUGIN

    @Deprecated
    public Map<String, Lifecycle> getPhaseToLifecycleMap() {
        return defaultLifeCycles.getPhaseToLifecycleMap();
    }

    // Used by m2eclipse

    @SuppressWarnings({"UnusedDeclaration"})
    public MavenExecutionPlan calculateExecutionPlan(MavenSession session, boolean setup, String... tasks)
            throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
                    MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
                    PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
                    PluginVersionResolutionException {<FILL_FUNCTION_BODY>}

    public MavenExecutionPlan calculateExecutionPlan(MavenSession session, String... tasks)
            throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
                    MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
                    PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
                    PluginVersionResolutionException {
        return calculateExecutionPlan(session, true, tasks);
    }

    // Site 3.x
    public void calculateForkedExecutions(MojoExecution mojoExecution, MavenSession session)
            throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException,
                    PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
                    LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException {
        lifecycleExecutionPlanCalculator.calculateForkedExecutions(mojoExecution, session);
    }

    // Site 3.x
    public List<MavenProject> executeForkedExecutions(MojoExecution mojoExecution, MavenSession session)
            throws LifecycleExecutionException {
        return mojoExecutor.executeForkedExecutions(mojoExecution, session);
    }
}

        List<TaskSegment> taskSegments =
                lifecycleTaskSegmentCalculator.calculateTaskSegments(session, Arrays.asList(tasks));

        TaskSegment mergedSegment = new TaskSegment(false);

        for (TaskSegment taskSegment : taskSegments) {
            mergedSegment.getTasks().addAll(taskSegment.getTasks());
        }

        return lifecycleExecutionPlanCalculator.calculateExecutionPlan(
                session, session.getCurrentProject(), mergedSegment.getTasks(), setup);
    
<no_super_class>