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.util.ArrayList;
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
30
31
32
33
34 public class MinMavenProjectStub extends CheckstyleProjectStub {
35
36 public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException {
37 return getCompileSourceRoots();
38 }
39
40
41 public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
42 List<String> list = new ArrayList<>(getCompileClasspathElements());
43 list.add(getBasedir() + "/target/test-classes");
44 return list;
45 }
46
47
48 public List<String> getCompileSourceRoots() {
49 return Collections.singletonList(getBasedir() + "/target/classes");
50 }
51
52
53 public List<String> getTestCompileSourceRoots() {
54 List<String> list = new ArrayList<>(getCompileSourceRoots());
55 list.add(getBasedir() + "/target/test-classes");
56 return list;
57 }
58
59
60 public List<ReportPlugin> getReportPlugins() {
61 ReportPlugin jxrPlugin = new ReportPlugin();
62
63 jxrPlugin.setArtifactId("maven-jxr-plugin");
64
65 return Collections.singletonList(jxrPlugin);
66 }
67
68
69 public Organization getOrganization() {
70 Organization organization = new Organization();
71
72 organization.setName("maven-plugin-tests");
73
74 return organization;
75 }
76
77
78 public String getInceptionYear() {
79 return "2006";
80 }
81
82
83 public Build getBuild() {
84 Build build = new Build();
85
86 build.setDirectory(getBasedir() + "/target/test-harness/checkstyle/min");
87
88 return build;
89 }
90
91 @Override
92 protected String getPOM() {
93 return "min-plugin-config.xml";
94 }
95 }