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 java.io.File;
23
24 import org.apache.maven.it.util.ResourceExtractor;
25
26
27
28
29
30 public class MavenITmng3284UsingCachedPluginsTest
31 extends AbstractMavenIntegrationTestCase
32 {
33
34 public MavenITmng3284UsingCachedPluginsTest()
35 {
36 super( "[2.1.0-M2,)" );
37 }
38
39
40
41
42
43
44
45 public void testitMNG3284()
46 throws Exception
47 {
48 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3284" );
49
50
51
52
53
54
55
56 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
57 verifier.setAutoclean( false );
58 verifier.deleteArtifacts( "org.apache.maven.its.mng3284" );
59 verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
60 verifier.addCliOption( "--settings" );
61 verifier.addCliOption( "settings.xml" );
62 verifier.executeGoal( "validate" );
63 verifier.verifyErrorFreeLog();
64 verifier.resetStreams();
65
66
67
68
69 verifier = newVerifier( testDir.getAbsolutePath() );
70 verifier.setAutoclean( false );
71 verifier.deleteDirectory( "mod-a/target" );
72 verifier.deleteDirectory( "mod-b/target" );
73 verifier.addCliOption( "--settings" );
74 verifier.addCliOption( "settings.xml" );
75 verifier.executeGoal( "validate" );
76 verifier.verifyErrorFreeLog();
77 verifier.resetStreams();
78
79 verifier.assertFilePresent( "mod-a/target/version-0.1.txt" );
80 verifier.assertFileNotPresent( "mod-a/target/version-0.2.txt" );
81 verifier.assertFilePresent( "mod-b/target/version-0.2.txt" );
82 verifier.assertFileNotPresent( "mod-b/target/version-0.1.txt" );
83 }
84
85 }