diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java
index 4f682c42e2..85993d0260 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java
@@ -48,21 +48,32 @@ public class MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3139" );
+ // phase 1: get the metadata into the local repo
+
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng3139" );
- verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+ verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.setLogFileName( "log1.txt" );
+ verifier.getCliOptions().add( "--settings" );
+ verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
- verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8",
+ // phase 2: trigger blacklisting of repo (by invalid URL) and check previously downloaded metadata is stil used
+
+ verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+
+ verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8",
Collections.singletonMap( "@baseurl@", "http://localhost:63412" ) );
verifier.setLogFileName( "log2.txt" );
+ verifier.getCliOptions().add( "--settings" );
+ verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
-
verifier.resetStreams();
}
diff --git a/its/core-it-suite/src/test/resources/mng-3139/pom-template.xml b/its/core-it-suite/src/test/resources/mng-3139/pom.xml
similarity index 83%
rename from its/core-it-suite/src/test/resources/mng-3139/pom-template.xml
rename to its/core-it-suite/src/test/resources/mng-3139/pom.xml
index 992d9c8ef3..7d4126978c 100644
--- a/its/core-it-suite/src/test/resources/mng-3139/pom-template.xml
+++ b/its/core-it-suite/src/test/resources/mng-3139/pom.xml
@@ -32,21 +32,6 @@ under the License.
Test that locally cached metadata of blacklisted repositories is consulted to resolve metaversions.
-
-
- maven-core-it
- @baseurl@/repo
-
- ignore
-
- always
-
-
- false
-
-
-
-
org.apache.maven.its.mng3139
diff --git a/its/core-it-suite/src/test/resources/mng-3139/settings-template.xml b/its/core-it-suite/src/test/resources/mng-3139/settings-template.xml
new file mode 100644
index 0000000000..d327a854b1
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-3139/settings-template.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+ central
+ @baseurl@/null
+ central
+
+
+
+
+ maven-core-it-repo
+
+
+ maven-core-it
+ @baseurl@/repo
+
+ ignore
+
+ always
+
+
+ false
+
+
+
+
+
+
+ maven-core-it-repo
+
+