From d4f473ea15cee048e307915048a8b2c589759684 Mon Sep 17 00:00:00 2001
From: Konrad Windszus The -source argument for the Java compiler. The {@code -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 The -target argument for the Java compiler. The {@code -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.8true
to include debugging information in the compiled class files.
+ * @see javac -g
+ * @see #debuglevel
*/
@Parameter(property = "maven.compiler.debug", defaultValue = "true")
private boolean debug = true;
@@ -145,19 +147,23 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
/**
* Set to true
to generate metadata for reflection on method parameters.
* @since 3.6.2
+ * @see javac -parameters
*/
@Parameter(property = "maven.compiler.parameters", defaultValue = "false")
private boolean parameters;
/**
- * Set to true
to Enable preview language features of the java compiler
+ * Set to true
to enable preview language features of the java compiler
* @since 3.10.1
+ * @see javac --enable-preview
*/
@Parameter(property = "maven.compiler.enablePreview", defaultValue = "false")
private boolean enablePreview;
/**
* Set to true
to show messages about what the compiler is doing.
+ *
+ * @see javac -verbose
*/
@Parameter(property = "maven.compiler.verbose", defaultValue = "false")
private boolean verbose;
@@ -183,39 +189,44 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
private boolean showWarnings;
/**
- *
* 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 o transitive dependencies of those + * from dependency management section. It only influences the resolution of transitive dependencies of those * top-level paths. *
* @@ -400,6 +418,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { * * * @since 3.1 + * @see javac -J */ @Parameter protected List* Note that {@code -J} options are only passed through if {@link #fork} is set to {@code true}. *
+ * @see javac -J */ @Parameter protected String compilerArgument; @@ -432,9 +452,10 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { * 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.
+ * If {@link #debug} is not turned on, this attribute will be ignored.
*
* @since 2.1
+ * @see javac -G:[lines,vars,source]
*/
@Parameter(property = "maven.compiler.debuglevel")
private String debuglevel;
@@ -443,6 +464,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
* Keyword to be appended to the -implicit:
command-line switch.
*
* @since 3.10.2
+ * @see javac -implicit
*/
@Parameter(property = "maven.compiler.implicit")
private String implicit;
@@ -543,8 +565,10 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
private boolean skipMultiThreadWarning;
/**
- * compiler can now use javax.tools if available in your current jdk, you can disable this feature
- * using -Dmaven.compiler.forceJavacCompilerUse=true or in the plugin configuration
+ * The underlying compiler now uses {@code javax.tools} API
+ * if available in your current JDK.
+ * Set this to {@code true} to always use the legacy
+ * {@code com.sun.tools.javac} API instead.
*
* @since 3.0
*/
diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
index 9142f99d..52da7ca8 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
@@ -54,10 +54,14 @@
import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
/**
- * Compiles application sources
+ * Compiles application sources.
+ * By default uses the javac compiler
+ * of the JDK used to execute Maven. This can be overwritten through Toolchains
+ * or parameter {@link AbstractCompilerMojo#compilerId}.
*
* @author Jason van Zyl
* @since 2.0
+ * @see javac Command
*/
@Mojo(
name = "compile",
@@ -118,9 +122,7 @@ public class CompilerMojo extends AbstractCompilerMojo {
private Set* Specify where to place generated source files created by annotation processing. Only applies to JDK 1.6+ - *
* * @since 2.2 */ @@ -128,7 +130,7 @@ public class CompilerMojo extends AbstractCompilerMojo { private File generatedSourcesDirectory; /** - * Set this to 'true' to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on + * Set this to {@code true} to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on * occasion. */ @Parameter(property = "maven.main.skip") @@ -153,7 +155,8 @@ public class CompilerMojo extends AbstractCompilerMojo { private boolean multiReleaseOutput; /** - * when forking and debug activated the commandline used will be dumped in this file + * When both {@link AbstractCompilerMojo#fork} and {@link AbstractCompilerMojo#debug} are enabled the commandline arguments used + * will be dumped to this file. * @since 3.10.0 */ @Parameter(defaultValue = "javac") diff --git a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java index 43aab2f9..d2203771 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java @@ -50,9 +50,13 @@ /** * 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 {@link AbstractCompilerMojo#compilerId}. * * @author Jason van Zyl * @since 2.0 + * @see javac Command */ @Mojo( name = "testCompile",