maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/project DefaultMavenProjectBuilder.java
Date Tue, 27 Jul 2004 02:53:19 GMT
jvanzyl     2004/07/26 19:53:19

  Modified:    maven-core/src/main/java/org/apache/maven/project
                        DefaultMavenProjectBuilder.java
  Log:
  o using maven.properties now
  {issue:MNG-48}
  
  Revision  Changes    Path
  1.11      +26 -36    maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
  
  Index: DefaultMavenProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultMavenProjectBuilder.java	26 Jul 2004 15:34:24 -0000	1.10
  +++ DefaultMavenProjectBuilder.java	27 Jul 2004 02:53:19 -0000	1.11
  @@ -16,21 +16,6 @@
    * limitations under the License.
    */
   
  -import java.io.File;
  -import java.io.FileReader;
  -import java.io.IOException;
  -import java.io.InputStreamReader;
  -import java.io.Reader;
  -import java.io.StringReader;
  -import java.io.StringWriter;
  -import java.util.ArrayList;
  -import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.LinkedList;
  -import java.util.List;
  -import java.util.Map;
  -import java.util.Properties;
  -
   import org.apache.maven.artifact.MavenArtifact;
   import org.apache.maven.artifact.factory.MavenArtifactFactory;
   import org.apache.maven.model.Dependency;
  @@ -42,8 +27,6 @@
   import org.apache.maven.project.path.PathTranslator;
   import org.apache.maven.project.validation.ModelValidationResult;
   import org.apache.maven.project.validation.ModelValidator;
  -import org.apache.maven.wagon.manager.WagonManager;
  -
   import org.codehaus.plexus.logging.AbstractLogEnabled;
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
   import org.codehaus.plexus.util.CollectionUtils;
  @@ -52,10 +35,27 @@
   import org.codehaus.plexus.util.dag.DAG;
   import org.codehaus.plexus.util.dag.TopologicalSorter;
   
  +import java.io.File;
  +import java.io.FileReader;
  +import java.io.IOException;
  +import java.io.InputStreamReader;
  +import java.io.Reader;
  +import java.io.StringReader;
  +import java.io.StringWriter;
  +import java.util.ArrayList;
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.LinkedList;
  +import java.util.List;
  +import java.util.Map;
  +import java.util.Properties;
  +
   public class DefaultMavenProjectBuilder
       extends AbstractLogEnabled
       implements MavenProjectBuilder, Initializable
   {
  +    public static final String MAVEN_PROPERTIES = "maven.properties";
  +
       private MavenArtifactFactory artifactory;
   
       private ModelInheritanceAssembler modelInheritanceAssembler;
  @@ -255,39 +255,29 @@
   
       private Map createProjectProperties( File descriptorDirectory )
       {
  -        // System properties
  +        File f;
  +
           Properties systemProperties = System.getProperties();
   
  -        // User build properties
  -        File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties"
);
  +        f = new File( System.getProperty( "user.home" ), MAVEN_PROPERTIES );
   
  -        Properties userBuildProperties = PropertyUtils.loadProperties( userBuildPropertiesFile
);
  +        Properties mavenProperties = PropertyUtils.loadProperties( f );
   
           // project build properties
  -        Properties projectBuildProperties = null;
  -        Properties projectProperties = null;
  +        Properties userOverridesMavenProperties = null;
   
           if ( descriptorDirectory != null )
           {
  -            File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties"
);
  -
  -            projectBuildProperties = PropertyUtils.loadProperties( projectBuildPropertiesFile
);
  +            f = new File( descriptorDirectory, MAVEN_PROPERTIES );
   
  -            // project properties
  -            File projectPropertiesFile = new File( descriptorDirectory, "project.properties"
);
  -
  -            projectProperties = PropertyUtils.loadProperties( projectPropertiesFile );
  +            userOverridesMavenProperties = PropertyUtils.loadProperties( f );
           }
   
  -        Properties defaultProperties = PropertyUtils.loadProperties( DefaultMavenProjectBuilder.class.getClassLoader().getResourceAsStream(
DEFAULTS_PROPERTIES ) );
  -
           Map result = CollectionUtils.mergeMaps( new Map[]
           {
               systemProperties,
  -            userBuildProperties,
  -            projectBuildProperties,
  -            projectProperties,
  -            defaultProperties,
  +            mavenProperties,
  +            userOverridesMavenProperties,
           } );
   
           // Set the basedir value in the context.
  
  
  

Mime
View raw message