1 package org.codehaus.gmavenplus.mojo;
2
3 import org.apache.maven.plugins.annotations.Mojo;
4 import org.apache.maven.plugins.annotations.Parameter;
5
6 import java.io.File;
7
8
9
10
11
12
13
14
15 @Mojo(name = "addTestStubSources", threadSafe = true)
16 public class AddTestStubSourcesMojo extends AbstractGroovyStubSourcesMojo {
17
18
19
20
21 @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/test")
22 protected File testStubsOutputDirectory;
23
24
25
26
27 @Parameter(property = "maven.test.skip", defaultValue = "false")
28 protected boolean skipTests;
29
30
31
32
33 @Override
34 public void execute() {
35 if (!skipTests) {
36 getLog().debug("Added test stub directory " + testStubsOutputDirectory.getAbsolutePath() + " to project test sources.");
37 project.addTestCompileSourceRoot(testStubsOutputDirectory.getAbsolutePath());
38 }
39 }
40
41 }