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