Author: jvanzyl Date: Mon Sep 26 14:36:18 2005 New Revision: 291754 URL: http://svn.apache.org/viewcvs?rev=291754&view=rev Log: o adding execution for goals/phases
Modified: maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java Modified: maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java?rev=291754&r1=291753&r2=291754&view=diff ============================================================================== --- maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java (original) +++ maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java Mon Sep 26 14:36:18 2005 @@ -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 @@ 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 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 @@ projects.add( p ); } - catch (ProjectBuildingException e) + catch ( ProjectBuildingException e ) { throw new MojoExecutionException( "Error loading " + pom, e ); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]