diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index 0c49775f..1e039dfd 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -138,6 +138,8 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { /** * Set to true 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; /** - *

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

+ * @see javac -source */ @Parameter(property = "maven.compiler.source", defaultValue = DEFAULT_SOURCE) protected String source; /** - *

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.8

+ * + * @see javac -target */ @Parameter(property = "maven.compiler.target", defaultValue = DEFAULT_TARGET) protected String target; /** - * The -release argument for the Java compiler, supported since Java9 + * The {@code -release} argument for the Java compiler, supported since Java9 * * @since 3.6 + * @see javac -release */ @Parameter(property = "maven.compiler.release") protected String release; /** - * The -encoding argument for the Java compiler. + * The {@code -encoding} argument for the Java compiler. * * @since 2.1 + * @see javac -encoding */ @Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}") private String encoding; @@ -286,6 +297,8 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { * * * @since 2.2 + * @see javac -proc + * @see javac Annotation Processing */ @Parameter private String proc; @@ -297,6 +310,8 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { *

* * @since 2.2 + * @see javac -processor + * @see javac Annotation Processing */ @Parameter private String[] annotationProcessors; @@ -335,6 +350,9 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { * Note: Exclusions are supported from version 3.11.0. * * @since 3.5 + * @see javac -processorpath + * @see javac Annotation Processing + * */ @Parameter private List annotationProcessorPaths; @@ -346,7 +364,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { *

*

* 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. *

* @@ -403,6 +421,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { * * * @since 3.1 + * @see javac -J */ @Parameter protected List compilerArgs; @@ -418,6 +437,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { *

* Note that {@code -J} options are only passed through if {@link #fork} is set to {@code true}. *

+ * @see javac -J */ @Parameter protected String compilerArgument; @@ -435,9 +455,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; @@ -446,6 +467,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; @@ -546,8 +568,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 incrementalExcludes = new HashSet<>(); /** - *

* 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",