diff --git a/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java b/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java index 9edf10ea..86b2fa4b 100644 --- a/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java +++ b/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java @@ -178,6 +178,11 @@ public class CompilerConfiguration */ private String debugFileName; + /** + * configure --enable-preview of java compiler + */ + private boolean enablePreview; + // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- @@ -632,6 +637,16 @@ public void setParameters(boolean parameters) this.parameters = parameters; } + public boolean isEnablePreview() + { + return enablePreview; + } + + public void setEnablePreview(boolean enablePreview) + { + this.enablePreview = enablePreview; + } + public void setProc(String proc ) { this.proc = proc; diff --git a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java index 2a2263d9..4b3e5ae8 100644 --- a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java +++ b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java @@ -332,6 +332,11 @@ public static String[] buildCompilerArguments( CompilerConfiguration config, Str args.add( "-parameters" ); } + if ( config.isEnablePreview() ) + { + args.add( "--enable-preview" ); + } + if ( config.isShowDeprecation() ) { args.add( "-deprecation" );