From 69bc57cf4aba2f23ae34bd28ca58ac68ae19a13c Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 6 Mar 2022 21:11:46 +1000 Subject: [PATCH 1/2] [MCOMPILER-426] add flag to enable-preview java compiler feature Signed-off-by: Olivier Lamy --- pom.xml | 2 +- .../maven/plugin/compiler/AbstractCompilerMojo.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b21709d0..41dcda43 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ under the License. ! The following property is used in the integration tests MCOMPILER-157 --> 3.5 - 2.11.0 + 2.11.1-SNAPSHOT 2.4.21 3.7.0 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 915d39f5..e0ec1dbe 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -140,6 +140,14 @@ public abstract class AbstractCompilerMojo @Parameter( property = "maven.compiler.parameters", defaultValue = "false" ) private boolean parameters; + + /** + * Set to true to Enable preview language features of the java compiler + * @since 3.10.1 + */ + @Parameter( property = "maven.compiler.enablePreview", defaultValue = "false" ) + private boolean enablePreview; + /** * Set to true to show messages about what the compiler is doing. */ @@ -695,6 +703,8 @@ public void execute() compilerConfiguration.setParameters( parameters ); + compilerConfiguration.setEnablePreview( enablePreview ); + compilerConfiguration.setVerbose( verbose ); compilerConfiguration.setShowWarnings( showWarnings ); From 60b398c0f6221af2452e246bdf1fc82c735c4abd Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 7 Mar 2022 10:19:55 +1000 Subject: [PATCH 2/2] use plexus-compiler released version Signed-off-by: Olivier Lamy --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 41dcda43..442fbd69 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ under the License. ! The following property is used in the integration tests MCOMPILER-157 --> 3.5 - 2.11.1-SNAPSHOT + 2.11.1 2.4.21 3.7.0