Author: jdcasey
Date: Fri Jun  1 15:10:03 2007
New Revision: 543637

URL: http://svn.apache.org/viewvc?view=rev&rev=543637
Log:
OPEN - issue MNG-2619: building from the middle pom of a 
(parent,child,grandchild) heirarchy fails 
http://jira.codehaus.org/browse/MNG-2619

Added tests from the included patch. Main code didn't apply any longer, but 
this shows that the new ModelLineageBuilder code solves the problem. Will apply 
the original patch to the 2.0.x branch...

Added:
    
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/
    
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/
    
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/
    
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml
   (with props)
    
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml
   (with props)
    
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml
   (with props)
Modified:
    
maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java

Modified: 
maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java?view=diff&rev=543637&r1=543636&r2=543637
==============================================================================
--- 
maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java
 (original)
+++ 
maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java
 Fri Jun  1 15:10:03 2007
@@ -36,7 +36,7 @@
 import java.util.Properties;
 
 public class DefaultMavenProjectBuilderTest
-    extends PlexusTestCase
+    extends AbstractMavenProjectTestCase
 {
 
     private List filesToDelete = new ArrayList();
@@ -150,6 +150,22 @@
                       ( (Repository) repositories.get( 0 ) ).getId() );
     }
 
+    /**
+     * Check that we can build ok from the middle pom of a 
(parent,child,grandchild) heirarchy
+     * @throws Exception 
+     */
+    public void testBuildFromMiddlePom() throws Exception
+    {
+        File f1 = getTestFile( 
"src/test/resources/projects/grandchild-check/child/pom.xml");
+        File f2 = getTestFile( 
"src/test/resources/projects/grandchild-check/child/grandchild/pom.xml");
+
+        getProject( f1 );
+        
+        // it's the building of the grandchild project, having already cached 
the child project
+        // (but not the parent project), which causes the problem.
+        getProject( f2 );
+    }
+    
     protected ArtifactRepository getLocalRepository()
         throws Exception
     {

Added: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml?view=auto&rev=543637
==============================================================================
--- 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml
 (added)
+++ 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml
 Fri Jun  1 15:10:03 2007
@@ -0,0 +1,10 @@
+<project>
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+       <groupId>grandchildtest</groupId>
+       <artifactId>child</artifactId>
+       <version>1</version>
+       </parent>
+       <artifactId>grandchild</artifactId>
+
+</project>

Propchange: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml?view=auto&rev=543637
==============================================================================
--- 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml
 (added)
+++ 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml
 Fri Jun  1 15:10:03 2007
@@ -0,0 +1,13 @@
+<project>
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+       <groupId>grandchildtest</groupId>
+       <artifactId>root-pom</artifactId>
+       <version>1</version>
+       </parent>
+       <artifactId>child</artifactId>
+       <packaging>pom</packaging>
+  <modules>
+    <module>grandchild</module>
+  </modules>
+</project>

Propchange: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/child/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml?view=auto&rev=543637
==============================================================================
--- 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml
 (added)
+++ 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml
 Fri Jun  1 15:10:03 2007
@@ -0,0 +1,7 @@
+<project>
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>grandchildtest</groupId>
+       <artifactId>root-pom</artifactId>
+       <version>1</version>
+       <packaging>pom</packaging>
+</project>

Propchange: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/components/trunk/maven-project/src/test/resources/projects/grandchild-check/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


Reply via email to