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:
Jason van Zyl 2005-09-26 21:36:18 +00:00
parent b44c5bb224
commit 84e3f2c016
1 changed files with 15 additions and 6 deletions

View File

@ -57,6 +57,7 @@
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 @@ private RuntimeInfo createRuntimeInfo( Settings settings )
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,
@ -291,7 +300,7 @@ public void execute( MavenProject project, List goals, EventDispatcher eventDisp
}
}
public List collectProjects( File basedir, String[] includes, String[] excludes )
public List collectProjects( File basedir, String[] includes, String[] excludes )
throws MojoExecutionException
{
List projects = new ArrayList();
@ -309,7 +318,7 @@ public List collectProjects( File basedir, String[] includes, String[] excludes
projects.add( p );
}
catch (ProjectBuildingException e)
catch ( ProjectBuildingException e )
{
throw new MojoExecutionException( "Error loading " + pom, e );
}