maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven Maven.java
Date Thu, 16 Sep 2004 16:06:13 GMT
jdcasey     2004/09/16 09:06:13

  Modified:    maven-core/src/main/java/org/apache/maven/project
                        DefaultMavenProjectBuilder.java
               maven-core/src/main/java/org/apache/maven Maven.java
  Log:
  o Commented earlier changes until I have time to make them work properly
  o Added DEFAULT_MODEL_VERSION constant to Maven.class for referencing in case there is no
project POM
  
  Revision  Changes    Path
  1.13      +17 -1     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultMavenProjectBuilder.java	16 Sep 2004 14:26:18 -0000	1.12
  +++ DefaultMavenProjectBuilder.java	16 Sep 2004 16:06:13 -0000	1.13
  @@ -16,6 +16,7 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.Maven;
   import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.DefaultArtifact;
   import org.apache.maven.artifact.MavenMetadataSource;
  @@ -120,10 +121,19 @@
                   validateLeafModel(userModel);
                   
                   // TODO: rename to super-pom.xml so it is not used by the reactor
  -                superModel = modelReader.read( new InputStreamReader( DefaultMavenProjectBuilder.class.getResourceAsStream(
"pom-" + userModel.getModelVersion() + ".xml" ) ) );
  +                superModel = modelReader.read( new InputStreamReader( DefaultMavenProjectBuilder.class.getResourceAsStream(
"pom-4.0.0.xml" ) ) );
  +
  +                // [JDC 9/16]: Commented until I have time to figure this out... 
  +                // badmodelVersion somewhere
  +                //superModel = modelReader.read( new InputStreamReader( DefaultMavenProjectBuilder.class.getResourceAsStream(
"pom-" + userModel.getModelVersion() + ".xml" ) ) );
                   
                   superModel.getRepositories().addAll( userModel.getRepositories() );
               }
  +            
  +            if(superModel == null)
  +            {
  +                superModel = modelReader.read( new InputStreamReader( DefaultMavenProjectBuilder.class.getResourceAsStream(
"pom-" + Maven.DEFAULT_MODEL_VERSION + ".xml" ) ) );
  +            }
   
               if ( localRepositoryValue == null && superModel.getLocal() != null
&& superModel.getLocal().getRepository() != null )
               {
  @@ -223,6 +233,11 @@
   
       private void validateLeafModel( Model userModel )
       {
  +        // [JDC 9/16]:
  +        // Commenting this out until I have time to get this particular validation
  +        // fixed in all tests, core plugins, and IT's...
  +        
  +        /*
           String modelVersion = userModel.getModelVersion();
           if ( modelVersion == null || modelVersion.length() < 1 )
           {
  @@ -246,6 +261,7 @@
           {
               throw new IllegalStateException( "POM element \'version\' must be specified;
it may not be inherited" );
           }
  +        */
   
       }
   
  
  
  
  1.5       +3 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Maven.java	15 Sep 2004 12:30:04 -0000	1.4
  +++ Maven.java	16 Sep 2004 16:06:13 -0000	1.5
  @@ -32,6 +32,8 @@
   public interface Maven
   {
       static String ROLE = Maven.class.getName();
  +    
  +    static String DEFAULT_MODEL_VERSION = "4.0.0";
   
       // ----------------------------------------------------------------------
       // Execution
  
  
  

Mime
View raw message