diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java index d909c926be..94c957d42a 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java @@ -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(); + } + } diff --git a/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dep/1.0.0/dep-1.0.0.jar b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dep/1.0.0/dep-1.0.0.jar new file mode 100644 index 0000000000..9756569891 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dep/1.0.0/dep-1.0.0.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dep/1.0.0/dep-1.0.0.pom b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dep/1.0.0/dep-1.0.0.pom new file mode 100644 index 0000000000..0d712311fd --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dep/1.0.0/dep-1.0.0.pom @@ -0,0 +1,7 @@ + + + 4.0.0 + org.apache.maven.it.mng4148 + dep + 1.0.0 + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dependencies/1.0.0/dependencies-1.0.0.pom b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dependencies/1.0.0/dependencies-1.0.0.pom new file mode 100644 index 0000000000..a0b2c52f5c --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/dependencies/1.0.0/dependencies-1.0.0.pom @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.apache.maven.it.mng4148 + parent + 1.0.0 + + org.apache.maven.it.mng4148 + dependencies + 1.0.0 + pom + + + + org.apache.maven.it.mng4148 + dep + ${depVersion} + + + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/module/1.0.0/module-1.0.0.jar b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/module/1.0.0/module-1.0.0.jar new file mode 100644 index 0000000000..9756569891 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/module/1.0.0/module-1.0.0.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/module/1.0.0/module-1.0.0.pom b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/module/1.0.0/module-1.0.0.pom new file mode 100644 index 0000000000..d651fd8c98 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/module/1.0.0/module-1.0.0.pom @@ -0,0 +1,24 @@ + + + 4.0.0 + org.apache.maven.it.mng4148 + module + 1.0.0 + + + + org.apache.maven.it.mng4148 + dependencies + 1.0.0 + import + pom + + + + + + org.apache.maven.it.mng4148 + dep + + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/parent/1.0.0/parent-1.0.0.pom b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/parent/1.0.0/parent-1.0.0.pom new file mode 100644 index 0000000000..549b9b2e12 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4148/local-repository/org/apache/maven/it/mng4148/parent/1.0.0/parent-1.0.0.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + org.apache.maven.it.mng4148 + parent + 1.0.0 + pom + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-4148/pom.xml b/its/core-it-suite/src/test/resources/mng-4148/pom.xml new file mode 100644 index 0000000000..d4f08c18a6 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4148/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + org.apache.maven.it.mng4148 + mng-4148 + 1.0.0-SNAPSHOT + + + org.apache.maven.it.mng4148 + module + 1.0.0 + + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-4148/settings.xml b/its/core-it-suite/src/test/resources/mng-4148/settings.xml new file mode 100644 index 0000000000..842002fe5f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4148/settings.xml @@ -0,0 +1,16 @@ + + + + + inject-properties + + 1.2.2 + + + + + inject-properties + + \ No newline at end of file