mirror of https://github.com/apache/maven.git
o adding execution for goals/phases
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@291754 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b44c5bb224
commit
84e3f2c016
|
@ -57,6 +57,7 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Class intended to be used by clients who wish to embed Maven into their applications
|
||||
|
@ -260,18 +261,26 @@ public class MavenEmbedder
|
|||
return runtimeInfo;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Execution of phases/goals
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
public void execute( MavenProject project, List goals, EventDispatcher eventDispatcher, File executionRootDirectory )
|
||||
throws CycleDetectedException, LifecycleExecutionException, MojoExecutionException
|
||||
{
|
||||
List projects = new ArrayList();
|
||||
|
||||
projects.add( project );
|
||||
execute( Collections.singletonList( project ), goals, eventDispatcher, executionRootDirectory );
|
||||
}
|
||||
|
||||
public void execute( List projects, List goals, EventDispatcher eventDispatcher, File executionRootDirectory )
|
||||
throws CycleDetectedException, LifecycleExecutionException, MojoExecutionException
|
||||
{
|
||||
ReactorManager rm = new ReactorManager( projects );
|
||||
|
||||
rm.setFailureBehavior( ReactorManager.FAIL_AT_END );
|
||||
|
||||
rm.blackList( project );
|
||||
// The first project is blacklisted?
|
||||
|
||||
rm.blackList( (MavenProject) projects.get( 0 ) );
|
||||
|
||||
MavenSession session = new MavenSession( embedder.getContainer(),
|
||||
settings,
|
||||
|
@ -309,7 +318,7 @@ public class MavenEmbedder
|
|||
projects.add( p );
|
||||
|
||||
}
|
||||
catch (ProjectBuildingException e)
|
||||
catch ( ProjectBuildingException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error loading " + pom, e );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue