Class AbstractCompilerMojo
- All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo
- Direct Known Subclasses:
CompilerMojo
,TestCompilerMojo
JavaCompiler
interface from JDK 6+.
Each instance shall be used only once, then discarded.- Since:
- 2.0
- Author:
- Trygve Laugstøl, Martin Desruisseaux
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List
<DependencyCoordinate> Deprecated.protected boolean
Whether to use the Maven dependency management section when resolving transitive dependencies of annotation processor paths.protected String[]
Class names of annotation processors to run.protected org.apache.maven.api.services.ArtifactManager
protected Path
The directory to run the compiler from if fork is true.Additional arguments to be passed verbatim to the Java compiler.protected String
Deprecated.UsecompilerArgs
instead.protected String
Identifier of the compiler to use.protected String
Deprecated, for removal: This API element is subject to removal in a future version.Not supported anymore.protected String
Deprecated, for removal: This API element is subject to removal in a future version.This parameter is no longer used by the underlying compilers.protected boolean
Whether to generatepackage-info.class
even when empty.protected boolean
Whether to include debugging information in the compiled class files.protected String
Keyword list to be appended to the-g
command-line switch.protected boolean
Whether to enable preview language features of the java compiler.protected String
The-encoding
argument for the Java compiler.protected String
Executable of the compiler to use whenfork
istrue
.protected boolean
Whether the build will stop if there are compilation errors.protected boolean
Whether the build will stop if there are compilation warnings.File extensions to check timestamp for incremental build.protected Boolean
Deprecated, for removal: This API element is subject to removal in a future version.Ignored becausejava.lang.Compiler
has been deprecated and removed from the JDK.protected Boolean
Deprecated, for removal: This API element is subject to removal in a future version.Ignored because the compiler plugin now always use thejavax.tools
API.protected boolean
Allows running the compiler in a separate process.protected String
Whether to generate class files for implicitly referenced files.protected String
The algorithm to use for selecting which files to compile.Requirements for this JDK toolchain for using a differentjavac
than the one of the JDK used by Maven.protected org.apache.maven.api.plugin.Log
The logger for reporting information or warnings to the user.protected String
Maximum size, in megabytes, of the memory allocation pool iffork
is set totrue
.protected String
Initial size, in megabytes, of the memory allocation pool iffork
is set totrue
.protected org.apache.maven.api.services.MessageBuilderFactory
protected String
The--module-version
argument for the Java compiler.protected Path
Path to a file where to cache information about the last incremental build.protected Boolean
Deprecated, for removal: This API element is subject to removal in a future version.This property is ignored.protected String
Deprecated, for removal: This API element is subject to removal in a future version.Bundling many class files into a single file should be done by other plugins.protected String
Deprecated, for removal: This API element is subject to removal in a future version.Not used by the compiler plugin since it does not generate archive.protected boolean
Whether to generate metadata for reflection on method parameters.protected String
Whether annotation processing is performed or not.protected org.apache.maven.api.Project
The current project instance.protected org.apache.maven.api.services.ProjectManager
protected String
The--release
argument for the Java compiler.protected org.apache.maven.api.Session
The current build session instance.protected boolean
Whether to provide more details about why a module is rebuilt.protected boolean
Whether to show source locations where deprecated APIs are used.protected boolean
Whether to show compilation warnings.protected Boolean
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated as a consequence ofcompilerReuseStrategy
deprecation.protected String
The--source
argument for the Java compiler.protected int
The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.protected String
The--target
argument for the Java compiler.protected org.apache.maven.api.services.ToolchainManager
protected Boolean
Deprecated.Replaced byincrementalCompilation
.protected boolean
Whether to show messages about what the compiler is doing. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractCompilerMojo
(boolean isTestCompile) Creates a new MOJO. -
Method Summary
Modifier and TypeMethodDescriptionprotected Options
acceptParameters
(OptionChecker compiler) Parses the parameters declared in the MOJO.protected void
addImplicitDependencies
(Map<org.apache.maven.api.PathType, List<Path>> addTo, boolean hasModuleDeclaration) Adds dependencies others than the ones declared in POM file.protected void
addModuleOptions
(org.apache.maven.api.services.DependencyResolverResult dependencies, Options addTo) Generates options for handling the given dependencies.void
execute()
Runs the Java compiler.Returns the root directories of Java source files to compile.protected abstract String
Returns the file where to dump the command-line when debug logging is enabled or when the compilation failed.Returns the exclusion filters for the compiler, or an empty list if none.protected abstract Path
Returns the path where to place generated source files created by annotation processing.Returns the inclusion filters for the compiler, or an empty list for all Java source files.Returns the exclusion filters for the incremental calculation.protected abstract Path
Returns the destination directory (or class output directory) for class files.protected String
Returns the--release
argument for the Java compiler.protected String
Returns the--source
argument for the Java compiler.protected String
Returns the--target
argument for the Java compiler.
-
Field Details
-
moduleVersion
@Parameter(property="maven.compiler.moduleVersion", defaultValue="${project.version}") protected String moduleVersionThe--module-version
argument for the Java compiler. This is ignored if not applicable, e.g., in non-modular projects.- Since:
- 4.0.0
- See Also:
-
encoding
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") protected String encodingThe-encoding
argument for the Java compiler.- Since:
- 2.1
- See Also:
-
source
The--source
argument for the Java compiler.Notes:
- Since 3.8.0 the default value has changed from 1.5 to 1.6.
- Since 3.9.0 the default value has changed from 1.6 to 1.7.
- Since 3.11.0 the default value has changed from 1.7 to 1.8.
- Since 4.0.0-beta-2 the default value has been removed.
As of Java 9, the
release
parameter is preferred.
- See Also:
-
target
The--target
argument for the Java compiler.Notes:
- Since 3.8.0 the default value has changed from 1.5 to 1.6.
- Since 3.9.0 the default value has changed from 1.6 to 1.7.
- Since 3.11.0 the default value has changed from 1.7 to 1.8.
- Since 4.0.0-beta-2 the default value has been removed.
As of Java 9, the
release
parameter is preferred.
- See Also:
-
release
The--release
argument for the Java compiler. If omitted, then the compiler will generate bytecodes for the Java version running the compiler.- Since:
- 3.6
- See Also:
-
enablePreview
@Parameter(property="maven.compiler.enablePreview", defaultValue="false") protected boolean enablePreviewWhether to enable preview language features of the java compiler. Iftrue
, then the--enable-preview
option will be added to compiler arguments.- Since:
- 3.10.1
- See Also:
-
compilerArgs
Additional arguments to be passed verbatim to the Java compiler. This parameter can be used when the Maven compiler plugin does not provide a parameter for a Java compiler option. It may happen, for example, for new or preview Java features which are not yet handled by this compiler plugin.If an option has a value, the option and the value shall be specified in two separated
<arg>
elements. For example, the-Xmaxerrs 1000
option (for setting the maximal number of errors to 1000) can be specified as below (together with other options):
Note that<compilerArgs> <arg>-Xlint</arg> <arg>-Xmaxerrs</arg> <arg>1000</arg> <arg>J-Duser.language=en_us</arg> </compilerArgs>
-J
options should be specified only iffork
is set totrue
. Other options can be specified regardless thefork
value. The compiler plugin does not verify whether the arguments given through this parameter are valid. For this reason, the other parameters provided by the compiler plugin should be preferred when they exist, because the plugin checks whether the corresponding options are supported.- Since:
- 3.1
- See Also:
-
compilerArgument
Deprecated.UsecompilerArgs
instead.The single argument string to be passed to the compiler. To pass multiple arguments such as-Xmaxerrs 1000
(which are actually two arguments),compilerArgs
is preferred.Note that
-J
options should be specified only iffork
is set totrue
.- See Also:
-
proc
Whether annotation processing is performed or not. If not set, both compilation and annotation processing are performed at the same time. If set, the value will be appended to the-proc:
compiler option. Standard values are:none
– no annotation processing is performed.only
– only annotation processing is done, no compilation.full
– annotation processing and compilation are done.
full
was the default. Starting with JDK 21, this option must be set explicitly.- Since:
- 2.2
- See Also:
-
annotationProcessors
Class names of annotation processors to run. If not set, the default annotation processors discovery process applies. If set, the value will be appended to the-processor
compiler option.- Since:
- 2.2
- See Also:
-
annotationProcessorPaths
Deprecated.Replaced by ordinary dependencies with<type>
element set toproc
,classpath-proc
ormodular-proc
.Classpath elements to supply as annotation processor path. If specified, the compiler will detect annotation processors only in those classpath elements. If omitted, the default classpath is used to detect annotation processors. The detection itself depends on the configuration ofannotationProcessors
.Each classpath element is specified using their Maven coordinates (groupId, artifactId, version, classifier, type). Transitive dependencies are added automatically. Exclusions are supported as well. Example:
<configuration> <annotationProcessorPaths> <path> <groupId>org.sample</groupId> <artifactId>sample-annotation-processor</artifactId> <version>1.2.3</version> <!-- Optional - taken from dependency management if not specified --> <!-- Optionally exclude transitive dependencies --> <exclusions> <exclusion> <groupId>org.sample</groupId> <artifactId>sample-dependency</artifactId> </exclusion> </exclusions> </path> <!-- ... more ... --> </annotationProcessorPaths> </configuration>
Note: Exclusions are supported from version 3.11.0.- Since:
- 3.5
- See Also:
-
annotationProcessorPathsUseDepMgmt
@Parameter(defaultValue="false") protected boolean annotationProcessorPathsUseDepMgmtWhether to use the Maven dependency management section when resolving transitive dependencies of annotation processor paths.This flag does not enable / disable the ability to resolve the version of annotation processor paths from dependency management section. It only influences the resolution of transitive dependencies of those top-level paths.
- Since:
- 3.12.0
-
createMissingPackageInfoClass
@Parameter(property="maven.compiler.createMissingPackageInfoClass", defaultValue="false") protected boolean createMissingPackageInfoClassWhether to generatepackage-info.class
even when empty. By default, package info source files that only contain javadoc and no annotation on the package can lead to no class file being generated by the compiler. It may cause a file miss on build systems that check for file existence in order to decide what to recompile.If
true
, the-Xpkginfo:always
compiler option is added if the compiler supports that extra option. If the extra option is not supported, then a warning is logged and no option is added to the compiler arguments.- Since:
- 3.10
- See Also:
-
implicit
Whether to generate class files for implicitly referenced files. If set, the value will be appended to the-implicit:
compiler option. Standard values are:class
– automatically generates class files.none
– suppresses class file generation.
- Since:
- 3.10.2
- See Also:
-
parameters
@Parameter(property="maven.compiler.parameters", defaultValue="false") protected boolean parametersWhether to generate metadata for reflection on method parameters. Iftrue
, the-parameters
option will be added to compiler arguments.- Since:
- 3.6.2
- See Also:
-
debug
@Parameter(property="maven.compiler.debug", defaultValue="true") protected boolean debugWhether to include debugging information in the compiled class files. The amount of debugging information to include is specified by thedebuglevel
parameter. If thisdebug
flag istrue
, then the-g
option may be added to compiler arguments with a value determined by thedebuglevel
argument. If thisdebug
flag isfalse
, then the-g:none
option will be added to the compiler arguments.- See Also:
-
debuglevel
Keyword list to be appended to the-g
command-line switch. Legal values are a comma-separated list of the following keywords:lines
,vars
,source
andall
. If debug level is not specified, then the-g
option will not by added, which means that the default debugging information will be generated (typicallylines
andsource
but notvars
). Ifdebug
is turned off, this attribute will be ignored.- Since:
- 2.1
- See Also:
-
optimize
@Deprecated(forRemoval=true) @Parameter(property="maven.compiler.optimize") protected Boolean optimizeDeprecated, for removal: This API element is subject to removal in a future version.This property is ignored.Whether to optimize the compiled code using the compiler's optimization methods. -
verbose
@Parameter(property="maven.compiler.verbose", defaultValue="false") protected boolean verboseWhether to show messages about what the compiler is doing. Iftrue
, then the-verbose
option will be added to compiler arguments.- See Also:
-
showCompilationChanges
@Parameter(property="maven.compiler.showCompilationChanges", defaultValue="false") protected boolean showCompilationChangesWhether to provide more details about why a module is rebuilt. This is used only ifincrementalCompilation
is"inputTreeChanges"
.- See Also:
-
showDeprecation
@Parameter(property="maven.compiler.showDeprecation", defaultValue="false") protected boolean showDeprecationWhether to show source locations where deprecated APIs are used. Iftrue
, then the-deprecation
option will be added to compiler arguments. That option is itself a shorthand for-Xlint:deprecation
.- See Also:
-
showWarnings
@Parameter(property="maven.compiler.showWarnings", defaultValue="true") protected boolean showWarningsWhether to show compilation warnings. Iffalse
, then the-nowarn
option will be added to compiler arguments. That option is itself a shorthand for-Xlint:none
.- See Also:
-
failOnWarning
@Parameter(property="maven.compiler.failOnWarning", defaultValue="false") protected boolean failOnWarningWhether the build will stop if there are compilation warnings. Iftrue
, then the-Werror
option will be added to compiler arguments.- Since:
- 3.6
- See Also:
-
failOnError
@Parameter(property="maven.compiler.failOnError", defaultValue="true") protected boolean failOnErrorWhether the build will stop if there are compilation errors.- Since:
- 2.0.2
- See Also:
-
outputFileName
Deprecated, for removal: This API element is subject to removal in a future version.Bundling many class files into a single file should be done by other plugins.Sets the name of the output file when compiling a set of sources to a single file.expression="${project.build.finalName}"
-
outputTimestamp
@Deprecated(since="4.0.0", forRemoval=true) @Parameter(defaultValue="${project.build.outputTimestamp}") protected String outputTimestampDeprecated, for removal: This API element is subject to removal in a future version.Not used by the compiler plugin since it does not generate archive.Timestamp for reproducible output archive entries. It can be either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).- Since:
- 3.12.0
-
incrementalCompilation
The algorithm to use for selecting which files to compile. Values can bedependencies
,sources
,classes
,additions
,modules
ornone
.options
: recompile all source files if the compiler options changed. Changes are detected on a best-effort basis only.dependencies
: recompile all source files if at least one dependency (JAR file) changed since the last build. This check is based on the last modification times of JAR files.sources
: recompile source files modified since the last build. In addition, if a source file has been deleted, then all source files are recompiled. This check is based on the modification times of source files rather than the modification times of the*.class
files.classes
: recompile source files (*.java
) associated to no output file (*.class
) or associated to an output file older than the source. This algorithm does not check if a source file has been removed, potentially leaving non-recompiled classes with references to classes that no longer exist.The
sources
andclasses
values are partially redundant, doing the same work in different ways. It is usually not necessary to specify those two values.additions
: recompile all source files when the addition of a new file is detected. This aspect should be used together withsources
orclasses
. When used withclasses
, it provides a way to detect class renaming (this is not needed withsources
).modules
: recompile modules and let the compiler decides which individual files to recompile. The compiler plugin does not enumerate the source files to recompile (actually, it does not scan at all the source directories). Instead, it only specifies the module to recompile using the--module
option. The Java compiler will scan the source directories itself and compile only those source files that are newer than the corresponding files in the output directory.none
: the compiler plugin unconditionally specifies all sources to the Java compiler. This option is mutually exclusive with all other incremental compilation options.Limitations
In all cases, the current compiler-plugin does not detect structural changes other than file addition or removal. For example, the plugin does not detect whether a method has been removed in a class.- Since:
- 4.0.0
- See Also:
-
useIncrementalCompilation
@Deprecated(since="4.0.0") @Parameter(property="maven.compiler.useIncrementalCompilation") protected Boolean useIncrementalCompilationDeprecated.Replaced byincrementalCompilation
. A value oftrue
in this old property is equivalent to"dependencies,sources,additions"
in the new property, and a value offalse
is equivalent to"classes"
.Whether to enable/disable incremental compilation feature.- Since:
- 3.1
-
fileExtensions
File extensions to check timestamp for incremental build. Default contains onlyclass
andjar
. TODO: Rename with a name making clearer that this parameter is about incremental build.- Since:
- 3.1
- See Also:
-
staleMillis
@Parameter(property="lastModGranularityMs", defaultValue="0") protected int staleMillisThe granularity in milliseconds of the last modification date for testing whether a source needs recompilation.- See Also:
-
fork
@Parameter(property="maven.compiler.fork", defaultValue="false") protected boolean forkAllows running the compiler in a separate process. Iffalse
, the plugin uses the built-in compiler, while iftrue
it will use an executable.- See Also:
-
jdkToolchain
Requirements for this JDK toolchain for using a differentjavac
than the one of the JDK used by Maven. This overrules the toolchain selected by the maven-toolchain-plugin. See Guide to Toolchains for more info.<configuration> <jdkToolchain> <version>11</version> </jdkToolchain> ... </configuration> <configuration> <jdkToolchain> <version>1.8</version> <vendor>zulu</vendor> </jdkToolchain> ... </configuration>
- Since:
- 3.6
- See Also:
-
compilerId
Identifier of the compiler to use. This identifier shall match the identifier of a compiler known to the JDK tool chain, or the name of aJavaCompiler
instance registered as a service findable byServiceLoader
. See this guide for more information. If unspecified, then the system Java compiler is used. The identifier of the system Java compiler is usuallyjavac
.- See Also:
-
compilerVersion
@Deprecated(since="4.0.0", forRemoval=true) @Parameter(property="maven.compiler.compilerVersion") protected String compilerVersionDeprecated, for removal: This API element is subject to removal in a future version.This parameter is no longer used by the underlying compilers.Version of the compiler to use iffork
is set totrue
. Examples! "1.3", "1.5".- See Also:
-
forceLegacyJavacApi
@Deprecated(since="4.0.0", forRemoval=true) @Parameter(property="maven.compiler.forceLegacyJavacApi") protected Boolean forceLegacyJavacApiDeprecated, for removal: This API element is subject to removal in a future version.Ignored because the compiler plugin now always use thejavax.tools
API.Whether to use the legacycom.sun.tools.javac
API instead ofjavax.tools
API.- Since:
- 3.13
- See Also:
-
forceJavacCompilerUse
@Deprecated(since="4.0.0", forRemoval=true) @Parameter(property="maven.compiler.forceJavacCompilerUse") protected Boolean forceJavacCompilerUseDeprecated, for removal: This API element is subject to removal in a future version.Ignored becausejava.lang.Compiler
has been deprecated and removed from the JDK.Whether to use legacy compiler API.- Since:
- 3.0
-
compilerReuseStrategy
@Deprecated(since="4.0.0", forRemoval=true) @Parameter(property="maven.compiler.compilerReuseStrategy") protected String compilerReuseStrategyDeprecated, for removal: This API element is subject to removal in a future version.Not supported anymore. The reuse ofJavaFileManager
instance is plugin implementation details.Strategy to re usejavacc
class created. Legal values are:reuseCreated
(default) – will reuse already created but in case of multi-threaded builds, each thread will have its own instance.reuseSame
– the same Javacc class will be used for each compilation even for multi-threaded build.alwaysNew
– a new Javacc class will be created for each compilation.
- Since:
- 2.5
-
skipMultiThreadWarning
@Deprecated(since="4.0.0", forRemoval=true) @Parameter(property="maven.compiler.skipMultiThreadWarning") protected Boolean skipMultiThreadWarningDeprecated, for removal: This API element is subject to removal in a future version.Deprecated as a consequence ofcompilerReuseStrategy
deprecation.- Since:
- 2.5
-
executable
Executable of the compiler to use whenfork
istrue
. If this parameter is specified, then thejdkToolchain
is ignored.- See Also:
-
meminitial
Initial size, in megabytes, of the memory allocation pool iffork
is set totrue
. Examples: "64", "64M". Suffixes "k" (for kilobytes) and "G" (for gigabytes) are also accepted. If no suffix is provided, "M" is assumed.- Since:
- 2.0.1
- See Also:
-
maxmem
Maximum size, in megabytes, of the memory allocation pool iffork
is set totrue
. Examples: "128", "128M". Suffixes "k" (for kilobytes) and "G" (for gigabytes) are also accepted. If no suffix is provided, "M" is assumed.- Since:
- 2.0.1
- See Also:
-
basedir
The directory to run the compiler from if fork is true. -
mojoStatusPath
@Parameter(defaultValue="${project.build.directory}/maven-status/${mojo.plugin.descriptor.artifactId}/${mojo.executionId}.cache", required=true, readonly=true) protected Path mojoStatusPathPath to a file where to cache information about the last incremental build. This is used when "incremental" builds are enabled for detecting additions or removals of source files, or changes in plugin configuration. This file should be in the output directory and can be deleted at any time -
session
@Inject protected org.apache.maven.api.Session sessionThe current build session instance. -
project
@Inject protected org.apache.maven.api.Project projectThe current project instance. -
projectManager
@Inject protected org.apache.maven.api.services.ProjectManager projectManager -
artifactManager
@Inject protected org.apache.maven.api.services.ArtifactManager artifactManager -
toolchainManager
@Inject protected org.apache.maven.api.services.ToolchainManager toolchainManager -
messageBuilderFactory
@Inject protected org.apache.maven.api.services.MessageBuilderFactory messageBuilderFactory -
logger
@Inject protected org.apache.maven.api.plugin.Log loggerThe logger for reporting information or warnings to the user. Currently, this is also used for console output.
-
-
Constructor Details
-
AbstractCompilerMojo
protected AbstractCompilerMojo(boolean isTestCompile) Creates a new MOJO.- Parameters:
isTestCompile
-true
for compiling tests, orfalse
for compiling the main code
-
-
Method Details
-
getCompileSourceRoots
Returns the root directories of Java source files to compile.. If the sources are organized according the Module Source Hierarchy, then the list shall enumerate the root source directory for each module.- Returns:
- the root directories of Java source files to compile
-
getIncludes
Returns the inclusion filters for the compiler, or an empty list for all Java source files.. The filter patterns are described inFileSystem.getPathMatcher(String)
. If no syntax is specified, the default syntax is "glob".- Returns:
- the inclusion filters for the compiler, or an empty list for all Java source files
-
getExcludes
Returns the exclusion filters for the compiler, or an empty list if none.. The filter patterns are described inFileSystem.getPathMatcher(String)
. If no syntax is specified, the default syntax is "glob".- Returns:
- the exclusion filters for the compiler, or an empty list if none
-
getIncrementalExcludes
Returns the exclusion filters for the incremental calculation.. Updated source files, if excluded by this filter, will not cause the project to be rebuilt.- Returns:
- the exclusion filters for the incremental calculation
- See Also:
-
getOutputDirectory
Returns the destination directory (or class output directory) for class files.. This directory will be given to the-d
Java compiler option.- Returns:
- the destination directory (or class output directory) for class files
-
getSource
Returns the--source
argument for the Java compiler.. The default implementation returns thesource
value.- Returns:
- the
--source
argument for the Java compiler
-
getTarget
Returns the--target
argument for the Java compiler.. The default implementation returns thetarget
value.- Returns:
- the
--target
argument for the Java compiler
-
getRelease
Returns the--release
argument for the Java compiler.. The default implementation returns therelease
value.- Returns:
- the
--release
argument for the Java compiler
-
getGeneratedSourcesDirectory
Returns the path where to place generated source files created by annotation processing..- Returns:
- the path where to place generated source files created by annotation processing
-
addImplicitDependencies
protected void addImplicitDependencies(Map<org.apache.maven.api.PathType, List<Path>> addTo, boolean hasModuleDeclaration) throws IOExceptionAdds dependencies others than the ones declared in POM file. The typical case is the compilation of tests, which depends on the main compilation outputs. The default implementation does nothing.- Parameters:
addTo
- where to add dependencieshasModuleDeclaration
- whether the main sources have or should have amodule-info
file- Throws:
IOException
- if this method needs to walk through directories and that operation failed
-
addModuleOptions
protected void addModuleOptions(org.apache.maven.api.services.DependencyResolverResult dependencies, Options addTo) throws IOException Generates options for handling the given dependencies. This method should do nothing when compiling the main classes, because themodule-info.java
file should contain all the required configuration. However, this method may need to add some-add-reads
options when compiling the test classes.- Parameters:
dependencies
- the project dependenciesaddTo
- where to add the options- Throws:
IOException
- if the module information of a dependency cannot be read
-
getDebugFileName
Returns the file where to dump the command-line when debug logging is enabled or when the compilation failed.. For example, if the value is"javac"
, then the Java compiler can be launched from the command-line by typingjavac @target/javac.args
. The debug file will contain the compiler options together with the list of source files to compile.Note: debug logging should not be confused with the
debug
flag.- Returns:
- the file where to dump the command-line when debug logging is enabled or when the compilation failed
-
execute
public void execute() throws org.apache.maven.api.plugin.MojoExceptionRuns the Java compiler.- Specified by:
execute
in interfaceorg.apache.maven.api.plugin.Mojo
- Throws:
org.apache.maven.api.plugin.MojoException
- if the compiler cannot be run
-
acceptParameters
Parses the parameters declared in the MOJO.- Parameters:
compiler
- the tools to use for verifying the validity of options- Returns:
- the options after validation
-
<type>
element set toproc
,classpath-proc
ormodular-proc
.