You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/05/06 10:22:29 UTC
svn commit: r168569 - in
/maven/components/trunk/maven-core/src/main/java/org/apache/maven:
DefaultMaven.java cli/MavenCli.java
Author: brett
Date: Fri May 6 01:22:28 2005
New Revision: 168569
URL: http://svn.apache.org/viewcvs?rev=168569&view=rev
Log:
use consistent ordering for reactored projects
Modified:
maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?rev=168569&r1=168568&r2=168569&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java (original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java Fri May 6 01:22:28 2005
@@ -33,10 +33,10 @@
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.ProjectSorter;
import org.apache.maven.reactor.ReactorException;
+import org.apache.maven.settings.Mirror;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.Mirror;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -45,8 +45,6 @@
import org.codehaus.plexus.i18n.I18N;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.dag.CycleDetectedException;
import java.io.File;
@@ -183,14 +181,21 @@
// TODO: Really should fail if it was not? What if it is aggregating - eg "ear"?
project.setPackaging( "pom" );
- String includes = StringUtils.join( project.getModules().iterator(), "/pom.xml," ) + "/pom.xml";
+ File basedir = file.getParentFile();
- if ( includes.indexOf( ".." ) >= 0 )
+ // Initial ordering is as declared in the modules section
+ List moduleFiles = new ArrayList( project.getModules().size() );
+ for ( Iterator i = project.getModules().iterator(); i.hasNext(); )
{
- throw new ProjectBuildingException( "Modules may not include '..'" );
+ String name = (String) i.next();
+ if ( name.indexOf( '/' ) >= 0 )
+ {
+ String message = "Illegal module name: " + name + " (cannot contain path characters)";
+ throw new ReactorException( message );
+ }
+ moduleFiles.add( new File( basedir, name + "/pom.xml" ) );
}
- List moduleFiles = FileUtils.getFiles( project.getFile().getParentFile(), includes, null );
List collectedProjects = collectProjects( moduleFiles, localRepository, recursive );
projects.addAll( collectedProjects );
project.setCollectedProjects( collectedProjects );
@@ -276,7 +281,7 @@
{
if ( pom.length() == 0 )
{
- throw new ProjectBuildingException( i18n.format( "empty.descriptor.error", pom.getName() ) );
+ throw new ProjectBuildingException( i18n.format( "empty.descriptor.error", pom ) );
}
}
Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java?rev=168569&r1=168568&r2=168569&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java (original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java Fri May 6 01:22:28 2005
@@ -291,6 +291,9 @@
String excludes = System.getProperty( "maven.reactor.excludes", POMv4 );
files = FileUtils.getFiles( userDir, includes, excludes );
+
+ // make sure there is consistent ordering on all platforms, rather than using the filesystem ordering
+ Collections.sort( files );
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org