Class AbstractGroovyStubSourcesMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractGenerateStubsMojo, AddStubSourcesMojo, AddTestStubSourcesMojo, RemoveStubsMojo, RemoveTestStubsMojo

public abstract class AbstractGroovyStubSourcesMojo extends AbstractGroovySourcesMojo
This mojo provides access to the Groovy sources (including stubs).
Since:
1.0-beta-3
Author:
Keegan Witt
  • Constructor Details

    • AbstractGroovyStubSourcesMojo

      public AbstractGroovyStubSourcesMojo()
  • Method Details

    • removeSourceRoot

      protected static void removeSourceRoot(org.apache.maven.project.MavenProject project, String scopeToRemove, File sourceDirectory) throws ClassNotFoundException, NoSuchFieldException, NoSuchMethodException, IllegalAccessException
      Removes the source roots from the project, using reflection to avoid breaking changes in Maven 4.
      Parameters:
      project - the Maven project
      scopeToRemove - the scope to remove (main or test)
      sourceDirectory - the source directory to remove
      Throws:
      ClassNotFoundException - when a class needed cannot be found
      NoSuchFieldException - when a field needed cannot be found
      NoSuchMethodException - when a method needed cannot be found
      IllegalAccessException - when a method needed cannot be accessed
    • getStubs

      protected Set<File> getStubs(File outputDirectory)
      Gets the set of stub files in specified directory.
      Parameters:
      outputDirectory - the directory to write stubs to
      Returns:
      The set of stub files in specified directory