o Extended IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@718690 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-11-18 19:42:23 +00:00
parent 1f6ea7f291
commit b75a13f0de
5 changed files with 149 additions and 0 deletions

View File

@ -53,6 +53,7 @@ public class MavenITmng3843PomInheritanceTest
verifier.deleteDirectory( "test-1/target" );
verifier.deleteDirectory( "test-2/target" );
verifier.deleteDirectory( "test-2/child-1/target" );
verifier.deleteDirectory( "test-3/sub-parent/child-a/target" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
@ -162,6 +163,10 @@ public class MavenITmng3843PomInheritanceTest
assertEquals( "parent-dep-b", props.getProperty( "project.dependencies.0.artifactId" ) );
assertEquals( "1", props.getProperty( "project.dependencyManagement.dependencies" ) );
assertEquals( "parent-dep-a", props.getProperty( "project.dependencyManagement.dependencies.0.artifactId" ) );
basedir = new File( verifier.getBasedir(), "test-3/sub-parent/child-a" );
props = verifier.loadProperties( "test-3/sub-parent/child-a/target/pom.properties" );
assertEquals( "../pom.xml", props.getProperty( "project.originalModel.parent.relativePath" ) );
}
private void assertPathEquals( File basedir, String expected, String actual )

View File

@ -35,5 +35,6 @@ under the License.
<modules>
<module>test-1</module>
<module>test-2</module>
<module>test-3/top-parent</module>
</modules>
</project>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<!--
This POM relies on the (non-inherited) default value for <relativePath> when referring to its parent.
-->
<parent>
<groupId>org.apache.maven.its.mng3843</groupId>
<artifactId>sub-parent</artifactId>
<version>0.1</version>
</parent>
<groupId>org.apache.maven.its.mng3843</groupId>
<artifactId>child-a</artifactId>
<version>0.1</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-expression</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>eval</goal>
</goals>
<configuration>
<outputFile>target/pom.properties</outputFile>
<expressions>
<expression>project/originalModel/parent</expression>
</expressions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<!--
This parent POM uses a non-default value for <relativePath> when referring to its parent.
-->
<parent>
<groupId>org.apache.maven.its.mng3843</groupId>
<artifactId>top-parent</artifactId>
<version>0.1</version>
<relativePath>../top-parent/pom.xml</relativePath>
</parent>
<groupId>org.apache.maven.its.mng3843</groupId>
<artifactId>sub-parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<modules>
<module>child-a</module>
</modules>
</project>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<!--
This parent POM exists merely to have another parent POM inherit from it.
-->
<groupId>org.apache.maven.its.mng3843</groupId>
<artifactId>top-parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<modules>
<module>../sub-parent</module>
</modules>
</project>