Compiles application test sources. By default uses the javac compiler of the JDK used to execute Maven. This can be overwritten through Toolchains or parameter compilerId
.
See also: javac Command
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 of annotationProcessors
.
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.
,
javac Annotation Processingjava.util.List<org.apache.maven.plugin.compiler.DependencyCoordinate>
3.5
No
Whether 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.
boolean
3.12.0
No
false
java.lang.String[]
2.2
No
The source directories containing the test-source to be compiled.
java.util.List<java.lang.String>
Yes
${project.testCompileSourceRoots}
Sets the arguments to be passed to the compiler.
Note that -J
options are only passed through if fork
is set to true
.
Example:
<compilerArgs> <arg>-Xmaxerrs</arg> <arg>1000</arg> <arg>-Xlint</arg> <arg>-J-Duser.language=en_us</arg> </compilerArgs>
java.util.List<java.lang.String>
3.1
No
Sets the unformatted single argument string to be passed to the compiler. To pass multiple arguments such as -Xmaxerrs 1000
(which are actually two arguments) you have to use compilerArgs
.
This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
Note that -J
options are only passed through if fork
is set to true
.
java.lang.String
No
Sets the arguments to be passed to the compiler (prepending a dash).
This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
Note that -J
options are only passed through if fork
is set to true
.
To pass -Xmaxerrs 1000 -Xlint -Xlint:-path -Averbose=true
you should include the following:
<compilerArguments> <Xmaxerrs>1000</Xmaxerrs> <Xlint/> <Xlint:-path/> <Averbose>true</Averbose> </compilerArguments>
java.util.Map<java.lang.String, java.lang.String>
2.0.1
No
The compiler id of the compiler to use. See this
guidefor more information.
java.lang.String
No
maven.compiler.compilerId
javac
Strategy to re use javacc class created:
reuseCreated
(default): will reuse already created but in case of multi-threaded builds, each thread will have its own instancereuseSame
: the same Javacc class will be used for each compilation even for multi-threaded buildalwaysNew
: a new Javacc class will be created for each compilationNote this parameter value depends on the os/jdk you are using, but the default value should work on most of env.
java.lang.String
2.5
No
maven.compiler.compilerReuseStrategy
${reuseCreated}
Deprecated.
This parameter is no longer evaluated by the underlying compilers, instead the actual version of the javac
binary is automatically retrieved.
Version of the compiler to use, ex. "1.3", "1.5", if
fork
is set to
true
.
java.lang.String
No
maven.compiler.compilerVersion
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. This causes a file miss on the next compilations and forces an unnecessary recompilation. The default value of true
causes an empty class file to be generated. This behavior can be changed by setting this parameter to false
.
boolean
3.10
No
maven.compiler.createMissingPackageInfoClass
true
Set to
true
to include debugging information in the compiled class files.
,
debuglevelboolean
No
maven.compiler.debug
true
when forking and debug activated the commandline used will be dumped in this file
java.lang.String
3.10.0
No
javac-test
Keyword list to be appended to the
-g
command-line switch. Legal values are none or a comma-separated list of the following keywords:
lines
,
vars
, and
source
. If debug level is not specified, by default, nothing will be appended to
-g
. If
debug
is not turned on, this attribute will be ignored.
java.lang.String
2.1
No
maven.compiler.debuglevel
boolean
3.10.1
No
maven.compiler.enablePreview
false
java.lang.String
2.1
No
encoding
${project.build.sourceEncoding}
Sets the executable of the compiler to use when
fork
is
true
.
java.lang.String
No
maven.compiler.executable
Indicates whether the build will continue even if there are compilation errors.
boolean
2.0.2
No
maven.compiler.failOnError
true
Indicates whether the build will continue even if there are compilation warnings.
boolean
3.6
No
maven.compiler.failOnWarning
false
File extensions to check timestamp for incremental build.
java.util.Set<java.lang.String>
3.1
No
class,jar
boolean
3.0
No
maven.compiler.forceJavacCompilerUse
false
boolean
3.13
No
maven.compiler.forceLegacyJavacApi
false
Allows running the compiler in a separate process. If false
it uses the built in compiler, while if true
it will use an executable.
boolean
No
maven.compiler.fork
false
Specify where to place generated source files created by annotation processing. Only applies to JDK 1.6+
java.io.File
2.2
No
${project.build.directory}/generated-test-sources/test-annotations
Keyword to be appended to the
-implicit:
command-line switch.
java.lang.String
3.10.2
No
maven.compiler.implicit
Specify the requirements for this jdk toolchain for using a different javac
than the one of the JRE used by Maven. This overrules the toolchain selected by the maven-toolchain-plugin.
(see
Guide to Toolchainsfor more info)
<configuration> <jdkToolchain> <version>11</version> </jdkToolchain> ... </configuration> <configuration> <jdkToolchain> <version>1.8</version> <vendor>zulu</vendor> </jdkToolchain> ... </configuration>note:
requires at least Maven 3.3.1
java.util.Map<java.lang.String, java.lang.String>
3.6
No
Sets the maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if
fork
is set to
true
.
java.lang.String
2.0.1
No
maven.compiler.maxmem
Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if
fork
is set to
true
.
java.lang.String
2.0.1
No
maven.compiler.meminitial
Deprecated.
This property is a no-op in javac
.
Set to true
to optimize the compiled code using the compiler's optimization methods.
boolean
No
maven.compiler.optimize
false
The directory where compiled test classes go.
This parameter should only be modified in special cases. See the CompilerMojo.outputDirectory
for more information.
CompilerMojo.outputDirectory
java.io.File
Yes
${project.build.testOutputDirectory}
Sets the name of the output file when compiling a set of sources to a single file.
expression="${project.build.finalName}"
java.lang.String
No
Timestamp for reproducible output archive entries, either formatted as ISO 8601
yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch (like
SOURCE_DATE_EPOCH).
java.lang.String
3.12.0
No
${project.build.outputTimestamp}
Set to
true
to generate metadata for reflection on method parameters.
boolean
3.6.2
No
maven.compiler.parameters
false
Sets whether annotation processing is performed or not. Only applies to JDK 1.6+ If not set, both compilation and annotation processing are performed at the same time.
Allowed values are:
none
- no annotation processing is performed.only
- only annotation processing is done, no compilation.full
- annotation processing and compilation.full
is the default. Starting with JDK 21, this option must be set explicitly.
,
javac Annotation Processingjava.lang.String
2.2
No
maven.compiler.proc
The
-release
argument for the Java compiler, supported since Java9
java.lang.String
3.6
No
maven.compiler.release
No description.
boolean
No
maven.compiler.showCompilationChanges
false
Sets whether to show source locations where deprecated APIs are used.
boolean
No
maven.compiler.showDeprecation
false
Set to false
to disable warnings during compilation.
boolean
No
maven.compiler.showWarnings
true
Set this to 'true' to bypass compilation of test sources. Its use is NOT RECOMMENDED, but quite convenient on occasion.
boolean
No
maven.test.skip
No description.
boolean
2.5
No
maven.compiler.skipMultiThreadWarning
false
The -source
argument for the Java compiler.
NOTE:
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
java.lang.String
No
maven.compiler.source
1.8
Sets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
int
No
lastModGranularityMs
0
The -target
argument for the Java compiler.
NOTE:
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
java.lang.String
No
maven.compiler.target
1.8
Sets the unformatted argument string to be passed to test compiler if fork is set to true.
This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
java.lang.String
2.1
No
Sets the arguments to be passed to test compiler (prepending a dash) if fork is set to true.
This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
java.util.Map<java.lang.String, java.lang.String>
2.1
No
A list of exclusion filters for the compiler.
java.util.Set<java.lang.String>
No
A list of inclusion filters for the compiler.
java.util.Set<java.lang.String>
No
A list of exclusion filters for the incremental calculation.
java.util.Set<java.lang.String>
3.11
No
the -release argument for the test Java compiler
java.lang.String
3.6
No
maven.compiler.testRelease
The -source argument for the test Java compiler.
java.lang.String
2.1
No
maven.compiler.testSource
The -target argument for the test Java compiler.
java.lang.String
2.1
No
maven.compiler.testTarget
to enable/disable incremental compilation feature.
This leads to two different modes depending on the underlying compiler. The default javac compiler does the following:
boolean
3.1
No
maven.compiler.useIncrementalCompilation
true
When true
, uses the module path when compiling with a release or target of 9+ and module-info.java or module-info.class is present. When false
, always uses the class path.
boolean
3.11
No
true
Set to
true
to show messages about what the compiler is doing.
boolean
No
maven.compiler.verbose
false
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4