[MNG-4148] integration test to verify that the fix for MNG-4347 also fixed this one.

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@813570 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2009-09-10 20:06:14 +00:00
parent 374e7fe7ef
commit eae4a70692
9 changed files with 126 additions and 3 deletions

View File

@ -41,8 +41,10 @@ public class MavenITmng4347ImportScopeWithSettingsProfilesTest
/**
* Test that profiles from settings.xml will be used to resolve import-scoped dependency POMs.
* In this case, the settings profile enables snapshot resolution on the central repository, which
* is required to resolve the import-scoped POM with a SNAPSHOT version.
*/
public void testit()
public void testMNG4347()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4347" );
@ -60,8 +62,6 @@ public class MavenITmng4347ImportScopeWithSettingsProfilesTest
verifier.setAutoclean( false );
verifier.getCliOptions().add( "-V" );
verifier.getCliOptions().add( "-X" );
verifier.getCliOptions().add( "-s" );
verifier.getCliOptions().add( "settings.xml" );
@ -73,4 +73,36 @@ public class MavenITmng4347ImportScopeWithSettingsProfilesTest
verifier.resetStreams();
}
/**
* Test that profiles from settings.xml will be used to resolve import-scoped dependency POMs.
* In this case, it's a property from the settings profile that needs to be used to resolve the
* version for a dependency in the import-scoped POM.
*/
public void testMNG4148()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4148" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
String localRepo = verifier.localRepo;
File dest = new File( localRepo );
File src = new File( testDir, "local-repository" );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.it.mng4148" );
FileUtils.copyDirectoryStructure( src, dest );
verifier.setAutoclean( false );
verifier.getCliOptions().add( "-s" );
verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>dep</artifactId>
<version>1.0.0</version>
</project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
</parent>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>dependencies</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>dep</artifactId>
<version>${depVersion}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>module</artifactId>
<version>1.0.0</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>dependencies</artifactId>
<version>1.0.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>dep</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
</project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>mng-4148</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.it.mng4148</groupId>
<artifactId>module</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>inject-properties</id>
<properties>
<depVersion>1.2.2</depVersion>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>inject-properties</activeProfile>
</activeProfiles>
</settings>