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...

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@543637 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2007-06-01 22:10:03 +00:00
parent dce22c78fb
commit f136fa7ace
4 changed files with 47 additions and 1 deletions

View File

@ -36,7 +36,7 @@ import java.util.List;
import java.util.Properties;
public class DefaultMavenProjectBuilderTest
extends PlexusTestCase
extends AbstractMavenProjectTestCase
{
private List filesToDelete = new ArrayList();
@ -150,6 +150,22 @@ public class DefaultMavenProjectBuilderTest
( (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
{

View File

@ -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>

View File

@ -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>

View File

@ -0,0 +1,7 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>grandchildtest</groupId>
<artifactId>root-pom</artifactId>
<version>1</version>
<packaging>pom</packaging>
</project>