Author: bentmann Date: Sun Feb 20 15:33:06 2011 New Revision: 1072612 URL: http://svn.apache.org/viewvc?rev=1072612&view=rev Log: [MNG-5000] [regression] child distributionManagment.site.url not correct in a flat directory layout when child's artifactId doesn't match its module name
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml (with props) Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=1072612&r1=1072611&r2=1072612&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Sun Feb 20 15:33:06 2011 @@ -87,6 +87,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenITmng5012CollectionVsArrayParamCoercionTest.class ); suite.addTestSuite( MavenITmng5011ConfigureCollectionArrayFromSystemPropTest.class ); suite.addTestSuite( MavenITmng5009AggregationCycleTest.class ); + suite.addTestSuite( MavenITmng5000ChildPathAwareUrlInheritanceTest.class ); suite.addTestSuite( MavenITmng4992MapStylePropertiesParamConfigTest.class ); suite.addTestSuite( MavenITmng4975ProfileInjectedPluginExecutionOrderTest.class ); suite.addTestSuite( MavenITmng4973ExtensionVisibleToPluginInReactorTest.class ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java?rev=1072612&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java Sun Feb 20 15:33:06 2011 @@ -0,0 +1,68 @@ +package org.apache.maven.it; + +/* + * 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. + */ + +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; + +import java.io.File; +import java.util.Properties; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5000">MNG-5000</a>. Note this is a subtle + * variation and not a duplicate of the test for MNG-2006. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng5000ChildPathAwareUrlInheritanceTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng5000ChildPathAwareUrlInheritanceTest() + { + super( "[2.0.11,2.0.99),[2.2.0,3.0-alpha-1),[3.0.3,)" ); + } + + /** + * Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name + * of its base directory as given in the parent's module section. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5000" ); + + Verifier verifier = newVerifier( new File( testDir, "different-from-artifactId" ).getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/pom.properties" ); + assertEquals( "http://project.url/child", props.getProperty( "project.url" ) ); + assertEquals( "http://viewvc.project.url/child", props.getProperty( "project.scm.url" ) ); + assertEquals( "http://scm.project.url/child", props.getProperty( "project.scm.connection" ) ); + assertEquals( "https://scm.project.url/child", props.getProperty( "project.scm.developerConnection" ) ); + assertEquals( "http://site.project.url/child", props.getProperty( "project.distributionManagement.site.url" ) ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml?rev=1072612&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml Sun Feb 20 15:33:06 2011 @@ -0,0 +1,66 @@ +<?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> + + <parent> + <groupId>org.apache.maven.its.mng5000</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <relativePath>../parent/pom.xml</relativePath> + </parent> + + <!-- NOTE: The artifact id being different from the project's directory name is the crucial piece here --> + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-5000 :: Child</name> + <description> + Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name + of its base directory as given in the parent's module section. + </description> + + <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/url</expression> + <expression>project/scm</expression> + <expression>project/distributionManagement/site</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml?rev=1072612&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml Sun Feb 20 15:33:06 2011 @@ -0,0 +1,53 @@ +<?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> + + <groupId>org.apache.maven.its.mng5000</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-5000</name> + <description> + Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name + of its base directory as given in the parent's module section. + </description> + + <modules> + <module>../different-from-artifactId</module> + </modules> + + <url>http://project.url/parent</url> + + <scm> + <url>http://viewvc.project.url/parent</url> + <connection>http://scm.project.url/parent</connection> + <developerConnection>https://scm.project.url/parent</developerConnection> + </scm> + <distributionManagement> + <site> + <url>http://site.project.url/parent</url> + <id>parent.site</id> + </site> + </distributionManagement> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5000/parent/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision