1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.project.inheritance.t12;
20
21 import java.io.File;
22 import java.util.Map;
23
24 import org.apache.maven.model.Plugin;
25 import org.apache.maven.project.MavenProject;
26 import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
27 import org.junit.jupiter.api.Test;
28
29 import static org.junit.jupiter.api.Assertions.assertNotNull;
30 import static org.junit.jupiter.api.Assertions.assertNull;
31
32
33
34
35
36 @Deprecated
37 class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
38
39
40
41
42
43
44
45
46
47
48
49 @Test
50 void testFalsePluginExecutionInheritValue() throws Exception {
51 File localRepo = getLocalRepositoryPath();
52
53 File pom0 = new File(localRepo, "p0/pom.xml");
54 File pom0Basedir = pom0.getParentFile();
55 File pom1 = new File(pom0Basedir, "p1/pom.xml");
56
57 getProjectWithDependencies(pom0);
58 MavenProject project1 = getProjectWithDependencies(pom1);
59
60 Map pluginMap = project1.getBuild().getPluginsAsMap();
61 Plugin compilerPlugin = (Plugin) pluginMap.get("org.apache.maven.plugins:maven-compiler-plugin");
62
63 assertNotNull(compilerPlugin);
64
65 Map executionMap = compilerPlugin.getExecutionsAsMap();
66 assertNull(
67 executionMap.get("test"),
68 "Plugin execution: 'test' should NOT exist in the compiler plugin specification for the child project!");
69 }
70 }