1 package org.apache.maven.project.inheritance.t12;
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 import java.util.Map;
24
25 import org.apache.maven.model.Plugin;
26 import org.apache.maven.project.MavenProject;
27 import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
28
29
30
31
32
33 public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase
34 {
35
36
37
38
39
40
41
42
43
44
45
46 public void testFalsePluginExecutionInheritValue() throws Exception
47 {
48 File localRepo = getLocalRepositoryPath();
49
50 File pom0 = new File( localRepo, "p0/pom.xml" );
51 File pom0Basedir = pom0.getParentFile();
52 File pom1 = new File( pom0Basedir, "p1/pom.xml" );
53
54 getProjectWithDependencies( pom0 );
55 MavenProject project1 = getProjectWithDependencies( pom1 );
56
57 Map pluginMap = project1.getBuild().getPluginsAsMap();
58 Plugin compilerPlugin = (Plugin) pluginMap.get( "org.apache.maven.plugins:maven-compiler-plugin" );
59
60 assertNotNull( compilerPlugin );
61
62 Map executionMap = compilerPlugin.getExecutionsAsMap();
63 assertNull( "Plugin execution: \'test\' should NOT exist in the compiler plugin specification for the child project!", executionMap.get( "test" ) );
64 }
65 }