1 package org.apache.maven.plugin.resources;
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.plugin.MojoExecutionException;
24 import org.apache.maven.plugins.annotations.LifecyclePhase;
25 import org.apache.maven.plugins.annotations.Mojo;
26 import org.apache.maven.plugins.annotations.Parameter;
27
28 import java.io.File;
29 import java.util.List;
30
31
32
33
34
35
36
37
38 @Mojo( name = "testResources", defaultPhase = LifecyclePhase.PROCESS_TEST_RESOURCES, threadSafe = true )
39 public class TestResourcesMojo
40 extends ResourcesMojo
41 {
42
43
44
45 @Parameter( defaultValue = "${project.build.testOutputDirectory}", required = true )
46 private File outputDirectory;
47
48
49
50
51 @Parameter( defaultValue = "${project.testResources}", required = true, readonly = false )
52 private List<Resource> resources;
53
54
55
56
57
58
59 @Parameter( property = "maven.test.skip" )
60 private boolean skip;
61
62
63
64
65 public void execute()
66 throws MojoExecutionException
67 {
68 if ( skip )
69 {
70 getLog().info( "Not copying test resources" );
71 }
72 else
73 {
74 super.execute();
75 }
76 }
77
78 public File getOutputDirectory()
79 {
80 return outputDirectory;
81 }
82
83 public void setOutputDirectory( File outputDirectory )
84 {
85 this.outputDirectory = outputDirectory;
86 }
87
88 public List<Resource> getResources()
89 {
90 return resources;
91 }
92
93 public void setResources( List<Resource> resources )
94 {
95 this.resources = resources;
96 }
97
98 }