Author: bentmann Date: Sat Sep 25 15:14:59 2010 New Revision: 1001233 URL: http://svn.apache.org/viewvc?rev=1001233&view=rev Log: [MNG-4834] [regression] MavenProject.getParent() ignores configured repositories
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/0.1/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/0.1/parent-0.1.pom maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.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=1001233&r1=1001232&r2=1001233&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 Sat Sep 25 15:14:59 2010 @@ -82,6 +82,7 @@ public class IntegrationTestSuite // ------------------------------------------------------------------------------------------------------------- // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4834ParentProjectResolvedFromRemoteReposTest.class ); suite.addTestSuite( MavenITmng4829ChecksumFailureWarningTest.class ); suite.addTestSuite( MavenITmng4814ReResolutionOfDependenciesDuringReactorTest.class ); suite.addTestSuite( MavenITmng4811CustomComponentConfiguratorTest.class ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java?rev=1001233&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java Sat Sep 25 15:14:59 2010 @@ -0,0 +1,66 @@ +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-4834">MNG-4834</a>. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4834ParentProjectResolvedFromRemoteReposTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4834ParentProjectResolvedFromRemoteReposTest() + { + super( "[2.0.3,3.0-alpha-1),[3.0,)" ); + } + + /** + * Verify that MavenProject.getParent() can (lazily) resolve the parent from repositories contributed by the + * settings. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4834" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4834" ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/pom.properties" ); + assertEquals( "PASSED", props.getProperty( "project.parent.description" ) ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml?rev=1001233&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml Sat Sep 25 15:14:59 2010 @@ -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.mng4834</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng4834</groupId> + <artifactId>test</artifactId> + <version>0.1-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4834</name> + <description> + Verify that MavenProject.getParent() can lazily resolve the parent from repositories contributed by the + settings. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>target/pom.properties</outputFile> + <expressions> + <expression>project/parent/description</expression> + </expressions> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/0.1/parent-0.1.pom URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/0.1/parent-0.1.pom?rev=1001233&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/0.1/parent-0.1.pom (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/repo/org/apache/maven/its/mng4834/parent/0.1/parent-0.1.pom Sat Sep 25 15:14:59 2010 @@ -0,0 +1,39 @@ +<?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.mng4834</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>MNG-4834-PARENT</name> + <description>PASSED</description> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> +</project> Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.xml?rev=1001233&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.xml Sat Sep 25 15:14:59 2010 @@ -0,0 +1,43 @@ +<?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. +--> + +<settings> + <profiles> + <profile> + <id>maven-core-it-repo</id> + <repositories> + <repository> + <id>maven-core-it</id> + <url>@baseurl@/repo</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + </profile> + </profiles> + <activeProfiles> + <activeProfile>maven-core-it-repo</activeProfile> + </activeProfiles> +</settings> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4834/settings-template.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision