1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.codehaus.gmavenplus.mojo;
18
19 import org.apache.maven.plugins.annotations.LifecyclePhase;
20 import org.apache.maven.plugins.annotations.Mojo;
21 import org.apache.maven.plugins.annotations.Parameter;
22
23 import java.io.File;
24
25
26
27
28
29
30
31
32 @Mojo(name = "removeStubs", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true)
33 public class RemoveStubsMojo extends AbstractGroovyStubSourcesMojo {
34
35
36
37
38 @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/main")
39 protected File stubsOutputDirectory;
40
41
42
43
44 @Override
45 public void execute() {
46 try {
47 project.getCompileSourceRoots().remove(stubsOutputDirectory.getAbsolutePath());
48 } catch (UnsupportedOperationException e) {
49 try {
50 removeSourceRoot(project, "main", stubsOutputDirectory);
51 } catch (Throwable e2) {
52 e.addSuppressed(e2);
53 throw e;
54 }
55 }
56 }
57
58 }