Search in sources :

Example 1 with MavenExecutionPlan

use of org.apache.maven.lifecycle.MavenExecutionPlan in project bndtools by bndtools.

the class BndConfigurator method execJarMojo.

private void execJarMojo(IMavenProjectFacade projectFacade, IProgressMonitor monitor) throws CoreException {
    MavenProject mavenProject = projectFacade.getMavenProject();
    if (mavenProject == null) {
        mavenProject = projectFacade.getMavenProject(monitor);
    }
    final IMaven maven = MavenPlugin.getMaven();
    final MavenExecutionPlan plan = maven.calculateExecutionPlan(mavenProject, Arrays.asList("jar:jar"), true, monitor);
    final List<MojoExecution> mojoExecutions = plan.getMojoExecutions();
    if (mojoExecutions != null) {
        for (MojoExecution mojoExecution : mojoExecutions) {
            MavenPlugin.getMaven().execute(mavenProject, mojoExecution, monitor);
        }
    }
}
Also used : MavenProject(org.apache.maven.project.MavenProject) MojoExecution(org.apache.maven.plugin.MojoExecution) MavenExecutionPlan(org.apache.maven.lifecycle.MavenExecutionPlan) IMaven(org.eclipse.m2e.core.embedder.IMaven)

Aggregations

MavenExecutionPlan (org.apache.maven.lifecycle.MavenExecutionPlan)1 MojoExecution (org.apache.maven.plugin.MojoExecution)1 MavenProject (org.apache.maven.project.MavenProject)1 IMaven (org.eclipse.m2e.core.embedder.IMaven)1