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
27
28
29
30
31
32 public class MavenITmng3983PluginResolutionFromProfileReposTest
33 extends AbstractMavenIntegrationTestCase
34 {
35
36 public MavenITmng3983PluginResolutionFromProfileReposTest()
37 {
38 super( ALL_MAVEN_VERSIONS );
39 }
40
41
42
43
44
45
46 public void testitFromPom()
47 throws Exception
48 {
49 requiresMavenVersion( "[2.0,3.0-alpha-1),[3.0-alpha-3,)" );
50
51 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3983/test-1" );
52
53 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
54 verifier.setForkJvm( true );
55 verifier.setAutoclean( false );
56 verifier.deleteDirectory( "target" );
57 verifier.deleteArtifacts( "org.apache.maven.its.mng3983" );
58 verifier.filterFile( "pom.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() );
59 verifier.executeGoal( "validate" );
60 verifier.verifyErrorFreeLog();
61 verifier.resetStreams();
62
63 verifier.assertArtifactPresent( "org.apache.maven.its.mng3983", "p", "0.1", "jar" );
64 }
65
66
67
68
69
70
71 public void testitFromProfilesXml()
72 throws Exception
73 {
74
75 requiresMavenVersion( "[2.0,3.0-alpha-1)" );
76
77 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3983/test-2" );
78
79 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
80 verifier.setForkJvm( true );
81 verifier.setAutoclean( false );
82 verifier.deleteDirectory( "target" );
83 verifier.deleteArtifacts( "org.apache.maven.its.mng3983" );
84 verifier.filterFile( "profiles.xml", "profiles.xml", "UTF-8", verifier.newDefaultFilterProperties() );
85 verifier.executeGoal( "validate" );
86 verifier.verifyErrorFreeLog();
87 verifier.resetStreams();
88
89 verifier.assertArtifactPresent( "org.apache.maven.its.mng3983", "p", "0.1", "jar" );
90 }
91
92
93
94
95
96
97 public void testitFromSettings()
98 throws Exception
99 {
100 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3983/test-3" );
101
102 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
103 verifier.setForkJvm( true );
104 verifier.setAutoclean( false );
105 verifier.deleteDirectory( "target" );
106 verifier.deleteArtifacts( "org.apache.maven.its.mng3983" );
107 verifier.filterFile( "settings.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
108 verifier.addCliOption( "--settings" );
109 verifier.addCliOption( "settings.xml" );
110 verifier.executeGoal( "validate" );
111 verifier.verifyErrorFreeLog();
112 verifier.resetStreams();
113
114 verifier.assertArtifactPresent( "org.apache.maven.its.mng3983", "p", "0.1", "jar" );
115 }
116
117 }