Skip to content

Commit 6795b0f

Browse files
authored
[MCOMPILER-426] add flag to enable-preview java compiler feature (#98)
* [MCOMPILER-426] add flag to enable-preview java compiler feature * use plexus-compiler 2.11.1 version Signed-off-by: Olivier Lamy <[email protected]>
1 parent 1de8c91 commit 6795b0f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ under the License.
6868
! The following property is used in the integration tests MCOMPILER-157
6969
-->
7070
<mavenPluginPluginVersion>3.5</mavenPluginPluginVersion>
71-
<plexusCompilerVersion>2.11.0</plexusCompilerVersion>
71+
<plexusCompilerVersion>2.11.1</plexusCompilerVersion>
7272

7373
<groovyVersion>2.4.21</groovyVersion>
7474
<groovyEclipseCompilerVersion>3.7.0</groovyEclipseCompilerVersion>

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

+10
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ public abstract class AbstractCompilerMojo
140140
@Parameter( property = "maven.compiler.parameters", defaultValue = "false" )
141141
private boolean parameters;
142142

143+
144+
/**
145+
* Set to <code>true</code> to Enable preview language features of the java compiler
146+
* @since 3.10.1
147+
*/
148+
@Parameter( property = "maven.compiler.enablePreview", defaultValue = "false" )
149+
private boolean enablePreview;
150+
143151
/**
144152
* Set to <code>true</code> to show messages about what the compiler is doing.
145153
*/
@@ -695,6 +703,8 @@ public void execute()
695703

696704
compilerConfiguration.setParameters( parameters );
697705

706+
compilerConfiguration.setEnablePreview( enablePreview );
707+
698708
compilerConfiguration.setVerbose( verbose );
699709

700710
compilerConfiguration.setShowWarnings( showWarnings );

0 commit comments

Comments
 (0)