Skip to content

Commit c2326c6

Browse files
authored
[MCOMPILER-577] Rename parameter "forceJavacCompilerUse" (#225)
Clarify meaning in javadoc
1 parent 3f9f0e4 commit c2326c6

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java

+16-4
Original file line numberDiff line numberDiff line change
@@ -567,16 +567,28 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
567567
@Parameter(defaultValue = "false", property = "maven.compiler.skipMultiThreadWarning")
568568
private boolean skipMultiThreadWarning;
569569

570+
/**
571+
* Legacy parameter name of {@link #forceLegacyJavacApi}. Only considered if {@link #forceLegacyJavacApi} is
572+
* not set or {@code false}.
573+
* @since 3.0
574+
* @deprecated Use {@link #forceLegacyJavacApi} instead
575+
*/
576+
@Deprecated
577+
@Parameter(defaultValue = "false", property = "maven.compiler.forceJavacCompilerUse")
578+
private boolean forceJavacCompilerUse;
579+
570580
/**
571581
* The underlying compiler now uses <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.compiler/javax/tools/package-summary.html">{@code javax.tools} API</a>
572582
* if available in your current JDK.
573583
* Set this to {@code true} to always use the legacy <a href="https://docs.oracle.com/en/java/javase/17/docs/api/jdk.compiler/com/sun/tools/javac/package-summary.html">
574584
* {@code com.sun.tools.javac} API</a> instead.
585+
* <p>
586+
* <em>This only has an effect for {@link #compilerId} being {@code javac} and {@link #fork} being {@code false}</em>.
575587
*
576-
* @since 3.0
588+
* @since 3.13
577589
*/
578-
@Parameter(defaultValue = "false", property = "maven.compiler.forceJavacCompilerUse")
579-
private boolean forceJavacCompilerUse;
590+
@Parameter(defaultValue = "false", property = "maven.compiler.forceLegacyJavacApi")
591+
private boolean forceLegacyJavacApi;
580592

581593
/**
582594
* @since 3.0 needed for storing the status for the incremental build support.
@@ -901,7 +913,7 @@ public void execute() throws MojoExecutionException, CompilationFailureException
901913
getLog().debug("CompilerReuseStrategy: "
902914
+ compilerConfiguration.getCompilerReuseStrategy().getStrategy());
903915

904-
compilerConfiguration.setForceJavacCompilerUse(forceJavacCompilerUse);
916+
compilerConfiguration.setForceJavacCompilerUse(forceLegacyJavacApi || forceJavacCompilerUse);
905917

906918
boolean canUpdateTarget;
907919

0 commit comments

Comments
 (0)