1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugins.source;
20
21 import java.util.Collections;
22 import java.util.List;
23
24 import org.apache.maven.model.Resource;
25 import org.apache.maven.plugins.annotations.LifecyclePhase;
26 import org.apache.maven.plugins.annotations.Mojo;
27 import org.apache.maven.plugins.annotations.Parameter;
28 import org.apache.maven.project.MavenProject;
29
30
31
32
33
34
35
36
37 @Mojo(name = "test-jar-no-fork", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true)
38 public class TestSourceJarNoForkMojo extends AbstractSourceJarMojo {
39
40
41
42 @Parameter(property = "maven.source.test.classifier", defaultValue = "test-sources")
43 protected String classifier;
44
45
46
47
48 protected List<String> getSources(MavenProject p) {
49 return p.getTestCompileSourceRoots();
50 }
51
52
53
54
55 protected List<Resource> getResources(MavenProject p) {
56 if (excludeResources) {
57 return Collections.emptyList();
58 }
59
60 return p.getTestResources();
61 }
62
63
64
65
66 protected String getClassifier() {
67 return classifier;
68 }
69 }