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