View Javadoc
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   * Adds Groovy stubs directory back to Maven's list of source directories. Normally, you won't need to use this mojo.
11   *
12   * @author Keegan Witt
13   * @since 1.1
14   */
15  @Mojo(name = "addStubSources", threadSafe = true)
16  public class AddStubSourcesMojo extends AbstractGroovyStubSourcesMojo {
17  
18      /**
19       * The location for the compiled classes.
20       */
21      @Parameter(defaultValue = "${project.build.directory}/generated-sources/groovy-stubs/main")
22      protected File stubsOutputDirectory;
23  
24      /**
25       * Executes this mojo.
26       */
27      @Override
28      public void execute() {
29          getLog().debug("Added stub directory " + stubsOutputDirectory.getAbsolutePath() + " to project sources.");
30          project.addCompileSourceRoot(stubsOutputDirectory.getAbsolutePath());
31      }
32  
33  }