MNG-5639 a test for resolving import scope POMs in DependencyManagement

The new feature is allowing the repository URL to contain a property.

Signed-off-by: Jason van Zyl <jason@tesla.io>
This commit is contained in:
Mark Ingram 2014-05-28 17:30:48 +01:00 committed by Jason van Zyl
parent 53c006a57c
commit e39582a1a0
7 changed files with 250 additions and 0 deletions

View File

@ -107,6 +107,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng5640LifecycleParticipantAfterSessionEnd.class );
suite.addTestSuite( MavenITmng5639ImportScopePomResolutionTest.class );
suite.addTestSuite( MavenITmng5608ProfileActivationWarningTest.class );
suite.addTestSuite( MavenITmng5591WorkspaceReader.class );
suite.addTestSuite( MavenITmng5581LifecycleMappingDelegate.class );

View File

@ -0,0 +1,64 @@
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.util.ResourceExtractor;
import java.io.File;
import java.util.List;
import java.util.Properties;
import java.util.regex.Pattern;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5639">MNG-5639</a>:
* Check that import POM defined in DependencyManagement can be resolved from a parameterised repository
*/
public class MavenITmng5639ImportScopePomResolutionTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng5639ImportScopePomResolutionTest()
{
super( "(3.2.2-SNAPSHOT,)" );
}
public void testitMNG5639()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5639-import-scope-pom-resolution" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.deleteArtifacts( "org.apache.maven.its.mng5639" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.addCliOption( "--settings" );
verifier.addCliOption( "settings.xml" );
verifier.executeGoal( "install" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertArtifactPresent( "org.apache.maven.its.mng5639", "b", "0.1", "jar" );
}
}

View File

@ -0,0 +1,60 @@
<?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.mng5639</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-5639</name>
<description>
Checks that an import POM in the dependencyManagement section can be successfully
resolved from a repository defining a URL that contains a property.
</description>
<properties>
<!-- Value corresponds to the folder name in this directory -->
<repository.url.suffix.property>repo-set-by-property</repository.url.suffix.property>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng5639</groupId>
<artifactId>a</artifactId>
<version>0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng5639</groupId>
<artifactId>b</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,46 @@
<?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.mng5639</groupId>
<artifactId>a</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng5639</groupId>
<artifactId>b</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -0,0 +1,36 @@
<?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.mng5639</groupId>
<artifactId>b</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
</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.
-->
<settings>
<profiles>
<profile>
<id>maven-core-it-repo</id>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/${repository.url.suffix.property}</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>maven-core-it-repo</activeProfile>
</activeProfiles>
</settings>