mirror of https://github.com/apache/maven.git
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:
parent
dce22c78fb
commit
f136fa7ace
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1,7 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>grandchildtest</groupId>
|
||||
<artifactId>root-pom</artifactId>
|
||||
<version>1</version>
|
||||
<packaging>pom</packaging>
|
||||
</project>
|
Loading…
Reference in New Issue