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 import org.codehaus.plexus.PlexusTestCase;
31
32
33
34
35 public class MultiMavenProjectStub extends CheckstyleProjectStub {
36
37 public MultiMavenProjectStub() {
38 setExecutionRoot(true);
39 }
40
41 @Override
42 public MavenProject getExecutionProject() {
43 return this;
44 }
45
46
47 public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException {
48 return Collections.emptyList();
49 }
50
51
52 public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
53 return Collections.emptyList();
54 }
55
56
57 public List<String> getCompileSourceRoots() {
58 return Collections.emptyList();
59 }
60
61
62 public List<String> getTestCompileSourceRoots() {
63 return Collections.emptyList();
64 }
65
66
67 public File getBasedir() {
68 return new File(PlexusTestCase.getBasedir());
69 }
70
71
72 public List<ReportPlugin> getReportPlugins() {
73 ReportPlugin jxrPlugin = new ReportPlugin();
74
75 jxrPlugin.setArtifactId("maven-jxr-plugin");
76
77 return Collections.singletonList(jxrPlugin);
78 }
79
80
81 public Organization getOrganization() {
82 Organization organization = new Organization();
83
84 organization.setName("maven-plugin-tests");
85
86 return organization;
87 }
88
89
90 public String getInceptionYear() {
91 return "2006";
92 }
93
94
95 public Build getBuild() {
96 Build build = new Build();
97
98 build.setDirectory(PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/multi");
99
100 return build;
101 }
102
103
104 public File getFile() {
105 File file = new File(getBasedir(), "pom.xml");
106
107 return file;
108 }
109 }