1 package org.apache.maven.it;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.it.util.ResourceExtractor;
23
24 import java.io.File;
25
26 public class MavenITmng7128BlockExternalHttpReactorTest
27 extends AbstractMavenIntegrationTestCase
28 {
29 private static final String PROJECT_PATH = "/mng-7128-block-external-http-reactor";
30
31 public MavenITmng7128BlockExternalHttpReactorTest()
32 {
33 super( "[3.8.1,)" );
34 }
35
36
37
38
39
40
41 public void testBlockedHttpRepositoryInPom() throws Exception
42 {
43 final File projectDir = ResourceExtractor.simpleExtractResources( getClass(), PROJECT_PATH );
44 final Verifier verifier = newVerifier( projectDir.getAbsolutePath() );
45 verifier.addCliOption( "-s settings.xml" );
46
47 try
48 {
49 verifier.executeGoal( "compiler:compile" );
50 fail( "HTTP repository defined in pom.xml should have failed the build but did not." );
51 }
52 catch ( VerificationException ve )
53 {
54
55 verifier.verifyTextInLog( "[ERROR] Failed to execute goal on project http-repository-in-pom: "
56 + "Could not resolve dependencies for project org.apache.maven.its.mng7128:http-repository-in-pom:jar:1.0: "
57 + "Failed to collect dependencies at junit:junit:jar:1.3: "
58 + "Failed to read artifact descriptor for junit:junit:jar:1.3: "
59 + "Could not transfer artifact junit:junit:pom:1.3 from/to maven-default-http-blocker (http://0.0.0.0/): " // mirror introduced in MNG-7118
60 + "Blocked mirror for repositories: [insecure-http-repo (http://repo.maven.apache.org/, default, releases+snapshots)]" );
61 }
62 }
63 }