Package org.codehaus.gmavenplus.mojo
Class AbstractCompileMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
org.codehaus.gmavenplus.mojo.AbstractCompileMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CompileMojo,CompileTestsMojo
The base compile mojo, which all compile mojos extend.
- Author:
- Keegan Witt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileA script for tweaking the configuration options (requires Groovy 2.1.0-beta-1 or greater).protected booleanWhether Groovy compiler should be set to debug.protected booleanwhether to fork the compilation.protected IncludeClasspathWhat classpath to include.protected booleanWhether to support invokeDynamic (requires Java 7 or greater and Groovy indy 2.0.0-beta-3 or greater).protected BooleanWhether to enable Groovy's parallel parsing.protected booleanGenerate metadata for reflection on method parameter names using the functionality provided by JEP 118 (requires Java 8 or greater and Groovy 2.5.0-alpha-1 or greater).protected booleanWhether the bytecode version has preview features enabled (JEP 12).protected booleanWhether to check that the version of Groovy used is able to use the requestedtargetBytecode.protected StringThe encoding of source files.protected StringThe Groovy compiler bytecode compatibility.protected intGroovy compiler error tolerance (the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted).protected org.apache.maven.toolchain.ToolchainManagerThe ToolchainManager.protected booleanWhether Groovy compiler should be set to verbose.protected intGroovy compiler warning level.Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
MAIN, TESTFields 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, pluginDescriptor, project, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected voidPerforms compilation of compile mojos.protected voidperformForkedCompilation(GroovyCompileConfiguration configuration, String javaExecutable) protected voidperformInProcessCompilation(GroovyCompileConfiguration configuration, List<?> classpath) Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
getFiles, getFilesets, getTestFiles, getTestFilesetsMethods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
getJavaExecutable, getJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isGroovyIndy, isJavaSupportIndy, isJavaSupportParameters, isJavaSupportPreviewFeatures, logPluginClasspath, setupClassWranglerMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
sourceEncoding
The encoding of source files. -
targetBytecode
The Groovy compiler bytecode compatibility. One of- 1.4 (or 4)
- 1.5 (or 5)
- 1.6 (or 6)
- 1.7 (or 7)
- 1.8 (or 8)
- 9 (or 1.9)
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
-
skipBytecodeCheck
@Parameter(property="skipBytecodeCheck", defaultValue="false") protected boolean skipBytecodeCheckWhether to check that the version of Groovy used is able to use the requestedtargetBytecode.- Since:
- 1.9.0
-
debug
@Parameter(defaultValue="false") protected boolean debugWhether Groovy compiler should be set to debug. -
verbose
@Parameter(defaultValue="false") protected boolean verboseWhether Groovy compiler should be set to verbose. -
warningLevel
@Parameter(defaultValue="1") protected int warningLevelGroovy compiler warning level. Should be one of:- 0
- None
- 1
- Likely Errors
- 2
- Possible Errors
- 3
- Paranoia
-
tolerance
@Parameter(defaultValue="0") protected int toleranceGroovy compiler error tolerance (the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted). -
invokeDynamic
@Parameter(defaultValue="false") protected boolean invokeDynamicWhether to support invokeDynamic (requires Java 7 or greater and Groovy indy 2.0.0-beta-3 or greater). Has no effect for Groovy 4, as it is always enabled. -
parallelParsing
Whether to enable Groovy's parallel parsing. Requires Groovy 3.0.5. Is enabled by default for Groovy 4.0.0-alpha-1 or newer.- Since:
- 1.11.0
-
configScript
A script for tweaking the configuration options (requires Groovy 2.1.0-beta-1 or greater). Note that its encoding must match your source encoding. -
parameters
@Parameter(defaultValue="false") protected boolean parametersGenerate metadata for reflection on method parameter names using the functionality provided by JEP 118 (requires Java 8 or greater and Groovy 2.5.0-alpha-1 or greater). -
includeClasspath
What classpath to include. One of- PROJECT_ONLY
- PROJECT_AND_PLUGIN
- PLUGIN_ONLY
- Since:
- 1.8.0
-
previewFeatures
@Parameter(defaultValue="false") protected boolean previewFeaturesWhether the bytecode version has preview features enabled (JEP 12). Requires Groovy >= 3.0.0-beta-1 or Groovy >= 2.5.7, but not any 2.6 versions and Java >= 12.- Since:
- 1.7.1
-
toolchainManager
@Component protected org.apache.maven.toolchain.ToolchainManager toolchainManagerThe ToolchainManager. -
fork
@Parameter(defaultValue="false") protected boolean forkwhether to fork the compilation.
-
-
Constructor Details
-
AbstractCompileMojo
public AbstractCompileMojo()
-
-
Method Details
-
doCompile
protected void doCompile(Set<File> sources, List classpath, File compileOutputDirectory) throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, MalformedURLException Performs compilation of compile mojos.- Parameters:
sources- the sources to compileclasspath- the classpath to use for compilationcompileOutputDirectory- the directory to write the compiled class files to- Throws:
ClassNotFoundException- when a class needed for compilation cannot be foundInstantiationException- when a class needed for compilation cannot be instantiatedIllegalAccessException- when a method needed for compilation cannot be accessedInvocationTargetException- when a reflection invocation needed for compilation cannot be completedMalformedURLException- when a classpath element provides a malformed URL
-
performInProcessCompilation
protected void performInProcessCompilation(GroovyCompileConfiguration configuration, List<?> classpath) throws MalformedURLException, ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException -
performForkedCompilation
protected void performForkedCompilation(GroovyCompileConfiguration configuration, String javaExecutable) -
buildForkClasspath
-