1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugins.checkstyle.stubs;
20
21 import java.io.File;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.apache.maven.artifact.DependencyResolutionRequiredException;
26 import org.apache.maven.model.Build;
27 import org.apache.maven.model.Organization;
28 import org.apache.maven.model.ReportPlugin;
29 import org.apache.maven.project.MavenProject;
30
31
32
33
34 public class MultiMavenProjectStub extends CheckstyleProjectStub {
35
36 public MultiMavenProjectStub() {
37 setExecutionRoot(true);
38 }
39
40 @Override
41 public MavenProject getExecutionProject() {
42 return this;
43 }
44
45
46 public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException {
47 return Collections.emptyList();
48 }
49
50
51 public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
52 return Collections.emptyList();
53 }
54
55
56 public List<String> getCompileSourceRoots() {
57 return Collections.emptyList();
58 }
59
60
61 public List<String> getTestCompileSourceRoots() {
62 return Collections.emptyList();
63 }
64
65
66 public List<ReportPlugin> getReportPlugins() {
67 ReportPlugin jxrPlugin = new ReportPlugin();
68
69 jxrPlugin.setArtifactId("maven-jxr-plugin");
70
71 return Collections.singletonList(jxrPlugin);
72 }
73
74
75 public Organization getOrganization() {
76 Organization organization = new Organization();
77
78 organization.setName("maven-plugin-tests");
79
80 return organization;
81 }
82
83
84 public String getInceptionYear() {
85 return "2006";
86 }
87
88
89 public Build getBuild() {
90 Build build = new Build();
91
92 build.setDirectory("target/test-harness/checkstyle/multi");
93
94 return build;
95 }
96
97
98 public File getFile() {
99 File file = new File(getBasedir(), "pom.xml");
100
101 return file;
102 }
103 }