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
31
32 public class MavenITmng2926PluginPrefixOrderTest
33 extends AbstractMavenIntegrationTestCase
34 {
35
36 public MavenITmng2926PluginPrefixOrderTest()
37 {
38 super( "(2.0.6,)" );
39 }
40
41
42
43
44
45
46
47 public void testitMNG2926()
48 throws Exception
49 {
50 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2926" );
51
52 Verifier verifier;
53
54 verifier = newVerifier( testDir.getAbsolutePath() );
55 verifier.deleteArtifacts( "org.apache.maven.its.mng2926" );
56 verifier.deleteArtifacts( "org.apache.maven.plugins", "mng-2926", "0.1" );
57 verifier.deleteArtifacts( "org.apache.maven.plugins", "mng-2926", "0.1" );
58 new File( verifier.getArtifactMetadataPath( "org.apache.maven.plugins", null, null, "maven-metadata-maven-core-it.xml" ) ).delete();
59 new File( verifier.getArtifactMetadataPath( "org.apache.maven.plugins", null, null, "resolver-status.properties" ) ).delete();
60 verifier.deleteArtifacts( "org.codehaus.mojo", "mng-2926", "0.1" );
61 verifier.deleteArtifacts( "org.codehaus.mojo", "mng-2926", "0.1" );
62 new File( verifier.getArtifactMetadataPath( "org.codehaus.mojo", null, null, "maven-metadata-maven-core-it.xml" ) ).delete();
63 new File( verifier.getArtifactMetadataPath( "org.codehaus.mojo", null, null, "resolver-status.properties" ) ).delete();
64 verifier.resetStreams();
65
66 verifier = newVerifier( testDir.getAbsolutePath() );
67 verifier.setAutoclean( false );
68 verifier.setLogFileName( "log-default.txt" );
69 verifier.filterFile( "settings-default-template.xml", "settings-default.xml", "UTF-8",
70 verifier.newDefaultFilterProperties() );
71 verifier.addCliOption( "--settings" );
72 verifier.addCliOption( "settings-default.xml" );
73 verifier.executeGoal( "mng-2926:apache" );
74 verifier.verifyErrorFreeLog();
75 verifier.resetStreams();
76
77 verifier = newVerifier( testDir.getAbsolutePath() );
78 verifier.setAutoclean( false );
79 verifier.setLogFileName( "log-custom.txt" );
80 verifier.filterFile( "settings-custom-template.xml", "settings-custom.xml", "UTF-8",
81 verifier.newDefaultFilterProperties() );
82 verifier.addCliOption( "--settings" );
83 verifier.addCliOption( "settings-custom.xml" );
84 verifier.executeGoal( "mng-2926:custom" );
85 verifier.verifyErrorFreeLog();
86 verifier.resetStreams();
87 }
88
89 }