Example usage for org.apache.maven.lifecycle LifecycleExecutor calculateExecutionPlan

List of usage examples for org.apache.maven.lifecycle LifecycleExecutor calculateExecutionPlan

Introduction

In this page you can find the example usage for org.apache.maven.lifecycle LifecycleExecutor calculateExecutionPlan.

Prototype

MavenExecutionPlan calculateExecutionPlan(MavenSession session, boolean setup, String... tasks)
            throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
            MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
            PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
            PluginVersionResolutionException;

Source Link

Usage

From source file:org.sonarsource.scanner.maven.bootstrap.JavaVersionResolver.java

License:Open Source License

public JavaVersionResolver(MavenSession session, LifecycleExecutor lifecycleExecutor, Log log) {
    this.session = session;
    this.log = log;
    this.mojoExecutions = new LinkedList<>();
    try {//w w  w. j av  a 2 s .  c  o  m
        this.mojoExecutions = lifecycleExecutor.calculateExecutionPlan(session, true, COMPILE_GOAL)
                .getMojoExecutions();
    } catch (Exception e) {
        log.warn(
                String.format("Failed to get mojo executions for goal '%s': %s", COMPILE_GOAL, e.getMessage()));
    }
}