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 @Parameter( property = "maven.test.skip" )
59 private boolean skip;
60
61
62
63
64 public void execute()
65 throws MojoExecutionException
66 {
67 if ( skip )
68 {
69 getLog().info( "Not copying test resources" );
70 }
71 else
72 {
73 super.execute();
74 }
75 }
76
77 public File getOutputDirectory()
78 {
79 return outputDirectory;
80 }
81
82 public void setOutputDirectory( File outputDirectory )
83 {
84 this.outputDirectory = outputDirectory;
85 }
86
87 public List<Resource> getResources()
88 {
89 return resources;
90 }
91
92 public void setResources( List<Resource> resources )
93 {
94 this.resources = resources;
95 }
96
97 }