You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/05/01 11:10:19 UTC
[maven-compiler-plugin] branch master updated: [MCOMPILER-534] Document conditional setting of the --release property
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 6dfe7f9 [MCOMPILER-534] Document conditional setting of the --release property
6dfe7f9 is described below
commit 6dfe7f9708a329c51005b79976574c090ca43655
Author: aherbert <a....@sussex.ac.uk>
AuthorDate: Tue Apr 25 12:21:07 2023 +0100
[MCOMPILER-534] Document conditional setting of the --release property
This closes #187
---
src/site/apt/examples/set-compiler-release.apt.vm | 26 +++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/site/apt/examples/set-compiler-release.apt.vm b/src/site/apt/examples/set-compiler-release.apt.vm
index 671b9d2..51219e0 100644
--- a/src/site/apt/examples/set-compiler-release.apt.vm
+++ b/src/site/apt/examples/set-compiler-release.apt.vm
@@ -80,3 +80,29 @@ Setting the <<<--release>>> of the Java Compiler
since Java 9. As such, the release number does not start with 1.x anymore. Also note that the
supported <<<release>>> targets include the release of the currently used JDK plus a limited number
of previous releases.
+
+* Usage on JDK 8
+
+ The <<<--release>>> option is not supported using JDK 8. To enable a project that targets Java 8
+ to be built using JDK 8 and also JDK 9 or later requires the conditional usage of the
+ <<<--release>>> option. This may be done through the use of a profile:
+
++-----
+<project>
+ [...]
+ <profiles>
+ [...]
+ <profile>
+ <id>set-compiler-release</id>
+ <activation>
+ <jdk>[9,)</jdk>
+ </activation>
+ <properties>
+ <maven.compiler.release>8</maven.compiler.release>
+ </properties>
+ </profile>
+ [...]
+ </profiles>
+ [...]
+</project>
++-----