[MNG-3948] Remote repos defined by profiles outside of settings.xml are not used to resolve parent POMs

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@730463 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-12-31 20:14:21 +00:00
parent f971b45d44
commit 8e5c507fe8
9 changed files with 323 additions and 0 deletions

View File

@ -90,6 +90,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng3948ParentResolutionFromProfileReposTest.class );
suite.addTestSuite( MavenITmng3947PluginDefaultExecutionConfigTest.class );
suite.addTestSuite( MavenITmng3944BasedirInterpolationTest.class );
suite.addTestSuite( MavenITmng3943PluginExecutionInheritanceTest.class );

View File

@ -0,0 +1,80 @@
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;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3948">MNG-3948</a>.
*
* @author Benjamin Bentmann
* @version $Id$
*/
public class MavenITmng3948ParentResolutionFromProfileReposTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng3948ParentResolutionFromProfileReposTest()
{
super( "(2.0.10,2.1.0-M1),(2.1.0-M1,)" );
}
/**
* Test that parent POMs can be resolved from remote repositories defined by (active) profiles in profiles.xml.
*/
public void testitFromProfilesXml()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3948/test-1" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng3948" );
verifier.filterFile( "profiles.xml", "profiles.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertArtifactPresent( "org.apache.maven.its.mng3948", "parent", "0.1", "pom" );
}
/**
* Test that parent POMs can be resolved from remote repositories defined by (active) profiles in the POM.
*/
public void testitFromPom()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3948/test-2" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng3948" );
verifier.filterFile( "pom.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertArtifactPresent( "org.apache.maven.its.mng3948", "parent", "0.2", "pom" );
}
}

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>
<parent>
<groupId>org.apache.maven.its.mng3948</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
</parent>
<artifactId>test</artifactId>
<name>Maven Integration Test :: MNG-3948</name>
<description>
Test that parent POMs can be resolved from remote repositories defined by (active) profiles in profiles.xml.
</description>
</project>

View File

@ -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.
-->
<profilesXml>
<activeProfiles>
<activeProfile>mng-3948</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>mng-3948</id>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</profilesXml>

View File

@ -0,0 +1,40 @@
<?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.mng3948</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<parentProperty>PASSED</parentProperty>
</properties>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3948</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<versioning>
<release>0.1</release>
<versions>
<version>0.1</version>
</versions>
<lastUpdated>20081231182545</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,58 @@
<?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.mng3948</groupId>
<artifactId>parent</artifactId>
<version>0.2</version>
</parent>
<artifactId>test</artifactId>
<name>Maven Integration Test :: MNG-3948</name>
<description>
Test that parent POMs can be resolved from remote repositories defined by (active) profiles in the POM.
</description>
<profiles>
<profile>
<id>mng-3948</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,40 @@
<?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.mng3948</groupId>
<artifactId>parent</artifactId>
<version>0.2</version>
<packaging>pom</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<parentProperty>PASSED</parentProperty>
</properties>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.its.mng3948</groupId>
<artifactId>parent</artifactId>
<version>0.2</version>
<versioning>
<release>0.2</release>
<versions>
<version>0.2</version>
</versions>
<lastUpdated>20081231182545</lastUpdated>
</versioning>
</metadata>