evenisse 2004/05/28 04:32:09 Modified: maven-core/src/main/java/org/apache/maven DefaultMavenCore.java Maven.java MavenCli.java MavenCore.java Log: Add the possibility to define includes and excludes project for the reactor processing with maven.reactor.includes and maven.reactor.excludes properties. Revision Changes Path 1.7 +9 -3 maven-components/maven-core/src/main/java/org/apache/maven/DefaultMavenCore.java Index: DefaultMavenCore.java =================================================================== RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/DefaultMavenCore.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DefaultMavenCore.java 20 May 2004 17:09:30 -0000 1.6 +++ DefaultMavenCore.java 28 May 2004 11:32:09 -0000 1.7 @@ -34,6 +34,7 @@ import org.codehaus.plexus.i18n.I18N; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; @@ -102,14 +103,14 @@ // Reactor execution // ---------------------------------------------------------------------- - public void executeReactor( String goal ) + public void executeReactor( String goals, String includes, String excludes ) throws ReactorException, GoalNotFoundException { List projects = new ArrayList(); try { - List files = FileUtils.getFiles( new File( System.getProperty( "user.dir" ) ), "**/project.xml,**/project2.xml", "project.xml,project2.xml" ); + List files = FileUtils.getFiles( new File( System.getProperty( "user.dir" ) ), includes, excludes ); for ( Iterator iterator = files.iterator(); iterator.hasNext(); ) { @@ -122,10 +123,15 @@ { throw new ReactorException( "Error processing projects for the reactor: ", e ); } + + String[] goalsList = StringUtils.split( goals, "," ); for ( Iterator iterator = projects.iterator(); iterator.hasNext(); ) { - execute( (MavenProject) iterator.next(), goal ); + for ( int i=0; i<goalsList.length; i++ ) + { + execute( (MavenProject) iterator.next(), goalsList[i] ); + } } } 1.17 +3 -3 maven-components/maven-core/src/main/java/org/apache/maven/Maven.java Index: Maven.java =================================================================== RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/Maven.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Maven.java 20 May 2004 17:09:30 -0000 1.16 +++ Maven.java 28 May 2004 11:32:09 -0000 1.17 @@ -91,10 +91,10 @@ // Reactor execution // ---------------------------------------------------------------------- - public void executeReactor( String goal ) + public void executeReactor( String goal, String includes, String excludes ) throws ReactorException, GoalNotFoundException { - maven.executeReactor( goal ); + maven.executeReactor( goal, includes, excludes ); } // ---------------------------------------------------------------------- 1.7 +14 -2 maven-components/maven-core/src/main/java/org/apache/maven/MavenCli.java Index: MavenCli.java =================================================================== RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/MavenCli.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MavenCli.java 20 May 2004 17:09:30 -0000 1.6 +++ MavenCli.java 28 May 2004 11:32:09 -0000 1.7 @@ -111,9 +111,21 @@ if ( commandLine.hasOption( CLIManager.REACTOR ) ) { + String includes = System.getProperty( "maven.reactor.includes", "**/project.xml,**/project2.xml" ); + String excludes = System.getProperty( "maven.reactor.excludes", "project.xml,project2.xml" ); + String goals = ""; for ( Iterator i = commandLine.getArgList().iterator(); i.hasNext(); ) { - maven.executeReactor( (String) i.next() ); + goals += (String) i.next(); + if ( i.hasNext() ) + { + goals += ","; + } + } + + if ( !"".equals( goals ) ) + { + maven.executeReactor( goals, includes, excludes ); } } else 1.6 +2 -2 maven-components/maven-core/src/main/java/org/apache/maven/MavenCore.java Index: MavenCore.java =================================================================== RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/MavenCore.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MavenCore.java 20 May 2004 17:09:30 -0000 1.5 +++ MavenCore.java 28 May 2004 11:32:09 -0000 1.6 @@ -49,7 +49,7 @@ // Reactor execution // ---------------------------------------------------------------------- - void executeReactor( String goal ) + void executeReactor( String goal, String includes, String excludes ) throws ReactorException, GoalNotFoundException; // ----------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]