You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by si...@apache.org on 2008/08/29 06:06:29 UTC

svn commit: r690095 - /maven/components/branches/sisbell-maven-2.1-profile/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java

Author: sisbell
Date: Thu Aug 28 21:06:28 2008
New Revision: 690095

URL: http://svn.apache.org/viewvc?rev=690095&view=rev
Log:
Minor update  of code: logs, javadocs, code

Modified:
    maven/components/branches/sisbell-maven-2.1-profile/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java

Modified: maven/components/branches/sisbell-maven-2.1-profile/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/sisbell-maven-2.1-profile/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java?rev=690095&r1=690094&r2=690095&view=diff
==============================================================================
--- maven/components/branches/sisbell-maven-2.1-profile/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java (original)
+++ maven/components/branches/sisbell-maven-2.1-profile/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java Thu Aug 28 21:06:28 2008
@@ -137,7 +137,6 @@
         List<DomainModel> domainModels = new ArrayList<DomainModel>();
         domainModels.add( domainModel );
 
-        MavenProject mavenParent = null;
         File parentFile = null;
         if ( domainModel.getModel().getParent() != null )
         {
@@ -175,11 +174,9 @@
         PomClassicDomainModel transformedDomainModel =
             ( (PomClassicDomainModel) ctx.transform( domainModels, transformer, transformer, importModels, properties ) );
        // System.out.println(transformedDomainModel.asString());
-        Model model = transformedDomainModel.getModel();
         try {
-            MavenProject mavenProject = new MavenProject( model, artifactFactory, mavenTools, repositoryHelper, null,
-                    projectBuilderConfiguration);
-            mavenProject.setParent(mavenParent);
+            MavenProject mavenProject = new MavenProject( transformedDomainModel.getModel(), artifactFactory,
+                    mavenTools, repositoryHelper, null, projectBuilderConfiguration);
             mavenProject.setParentFile(parentFile);
             return mavenProject;
         } catch (InvalidRepositoryException e) {
@@ -187,6 +184,13 @@
         }
     }
 
+    /**
+     * Returns true if the relative path of the specified parent references a pom, otherwise returns false.
+     *
+     * @param parent the parent model info
+     * @param projectDirectory the project directory of the child pom
+     * @return true if the relative path of the specified parent references a pom, otherwise returns fals
+     */
     private boolean isParentLocal( Parent parent, File projectDirectory )
     {
         try
@@ -231,7 +235,8 @@
             new PomClassicDomainModel( artifactParent.getFile()  );
         if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) )
         {
-            logger.warn( "Parent pom ids do not match: File = " + artifactParent.getFile().getAbsolutePath() );
+            logger.warn( "Parent pom ids do not match: Parent File = " + artifactParent.getFile().getAbsolutePath()
+                    + ": Child ID = " +  domainModel.getModel().getId() );
             return domainModels;
         }
         else
@@ -245,7 +250,15 @@
         return domainModels;
     }
 
-
+    /**
+     * Returns list of domain model parents of the specified domain model. The parent domain models are part  
+     *
+     * @param domainModel
+     * @param artifactResolver
+     * @param projectDirectory
+     * @return
+     * @throws IOException
+     */
     private List<DomainModel> getDomainModelParentsFromLocalPath( PomClassicDomainModel domainModel,
                                                                   PomArtifactResolver artifactResolver,
                                                                   File projectDirectory )
@@ -276,13 +289,14 @@
 
         if ( !parentFile.exists() )
         {
-            throw new IOException( "File does not exist: File =" + parentFile.getAbsolutePath() );
+            throw new IOException( "File does not exist: File = " + parentFile.getAbsolutePath() );
         }
 
         PomClassicDomainModel parentDomainModel = new PomClassicDomainModel( parentFile  );
         if ( !parentDomainModel.matchesParent( domainModel.getModel().getParent() ) )
         {
-            logger.warn( "Parent pom ids do not match: File = " + parentFile.getAbsolutePath() );
+            logger.warn( "Parent pom ids do not match: Parent File = " + parentFile.getAbsolutePath()
+                    + ": Child ID = " +  domainModel.getModel().getId() );
         }
 
         domainModels.add( parentDomainModel );
@@ -318,6 +332,4 @@
             throw new IOException( "Failed to validate: " + validationResult.toString() );
         }
     }
-
-
 }