Search in sources :

Example 1 with MojoExecutionKey

use of org.eclipse.m2e.core.project.configurator.MojoExecutionKey in project m2e-nar by maven-nar.

the class MavenUtils method getExecutions.

public static List<MojoExecution> getExecutions(final String goal, final ConfiguratorContext context, final IMavenProjectFacade facade, final IProgressMonitor monitor) throws CoreException {
    final List<MojoExecution> compileExecutions = new ArrayList<MojoExecution>();
    final Map<String, Set<MojoExecutionKey>> configuratorExecutions = AbstractProjectConfigurator.getConfiguratorExecutions(facade);
    final Set<MojoExecutionKey> executionKeys = configuratorExecutions.get(CProjectConfigurator.CONFIGURATOR_ID);
    if (executionKeys != null) {
        for (MojoExecutionKey key : executionKeys) {
            final MojoExecution mojoExecution = facade.getMojoExecution(key, monitor);
            if (goal.equals(mojoExecution.getGoal())) {
                compileExecutions.add(mojoExecution);
            }
        }
    }
    return compileExecutions;
}
Also used : Set(java.util.Set) MojoExecution(org.apache.maven.plugin.MojoExecution) ArrayList(java.util.ArrayList) MojoExecutionKey(org.eclipse.m2e.core.project.configurator.MojoExecutionKey)

Aggregations

ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 MojoExecution (org.apache.maven.plugin.MojoExecution)1 MojoExecutionKey (org.eclipse.m2e.core.project.configurator.MojoExecutionKey)1