Skip to content

Commit 9556b00

Browse files
committed
Bug 553050 - Support maven.compiler.release
Support setting maven.compilere.release property. Change-Id: Ibb6eb2f518d09c8b53f87b32941db4893622d4f3 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
1 parent 2df89d8 commit 9556b00

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ public String[] buildCompilerArguments(CompilerConfiguration config, CustomCompi
234234
args.add(config.getSourceVersion());
235235
}
236236

237+
if (!StringUtils.isEmpty(config.getReleaseVersion())) {
238+
args.add("--release");
239+
args.add(config.getReleaseVersion());
240+
}
241+
237242
if (!suppressEncoding(config) && !StringUtils.isEmpty(config.getSourceEncoding())) {
238243
args.add("-encoding");
239244
args.add(config.getSourceEncoding());

tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
114114
@Parameter(property = "maven.compiler.target")
115115
protected String target;
116116

117+
/**
118+
* The -release argument for the Java compiler
119+
*/
120+
@Parameter(property = "maven.compiler.release")
121+
protected String release;
122+
117123
/**
118124
* The -encoding argument for the Java compiler (kept for backwards compatibility)
119125
*
@@ -455,6 +461,9 @@ protected CompilerConfiguration getCompilerConfiguration(List<String> compileSou
455461
compilerConfiguration.setSourceVersion(source != null ? source : DEFAULT_SOURCE_VERSION);
456462

457463
compilerConfiguration.setTargetVersion(target != null ? target : DEFAULT_TARGET_VERSION);
464+
if (release != null) {
465+
compilerConfiguration.setReleaseVersion(release);
466+
}
458467

459468
compilerConfiguration.setSourceEncoding(getEncoding());
460469

0 commit comments

Comments
 (0)