Package org.codehaus.gmavenplus.mojo
Class AbstractGroovyStubSourcesMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
org.codehaus.gmavenplus.mojo.AbstractGroovyStubSourcesMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractGenerateStubsMojo
,AddStubSourcesMojo
,AddTestStubSourcesMojo
,RemoveStubsMojo
,RemoveTestStubsMojo
This mojo provides access to the Groovy sources (including stubs).
- Since:
- 1.0-beta-3
- Author:
- Keegan Witt
-
Field Summary
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
MAIN, TEST
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
classWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_1_8, JAVA_12, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the set of stub files in specified directory.protected static void
removeSourceRoot
(org.apache.maven.project.MavenProject project, String scopeToRemove, File sourceDirectory) Removes the source roots from the project, using reflection to avoid breaking changes in Maven 4.Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
getFiles, getFilesets, getTestFiles, getTestFilesets
Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
getJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isGroovyIndy, isJavaSupportIndy, isJavaSupportParameters, isJavaSupportPreviewFeatures, logPluginClasspath, setupClassWrangler
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
-
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 projectscopeToRemove
- the scope to remove (main or test)sourceDirectory
- the source directory to remove- Throws:
ClassNotFoundException
- when a class needed cannot be foundNoSuchFieldException
- when a field needed cannot be foundNoSuchMethodException
- when a method needed cannot be foundIllegalAccessException
- when a method needed cannot be accessed
-
getStubs
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
-