aherbert commented on code in PR #187:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/187#discussion_r1181267491


##########
src/site/apt/examples/set-compiler-release.apt.vm:
##########
@@ -80,3 +80,30 @@ 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 used to target an older Java release than the 
JDK used during the
+  build process. This flag is not supported using JDK 8. To enable a project 
that targets Java 8
+  to be built using JDK 8 or later requires the conditional usage of the 
<<<--release>>> option.

Review Comment:
   Change "it requires this flag" to "it requires this flag when using a JDK 
later than 8".
   
   If you use the flag with JDK 8 then the build breaks. This was the original 
source of [MCOMPILER-534]. You can only use the flag with JDK 9+:
   
   ```
   Target   Tool chain   --release flag    Result
   Java 8   JDK 8        Y                 build error
   Java 8   JDK 8        N                 OK
   Java 8   JDK 9        Y                 OK (compiler targets Java 8)
   Java 8   JDK 9        N                 compiler targets Java 9 API methods 
that supersede Java 8 methods
   ```
   
   If this is not the desired behaviour, i.e. the --release flag should be 
harmless if set on JDK 8, then something should be changed in the compiler 
plugin. If you should not use the flag when using JDK 8, then this is what I am 
trying to address with this documentation.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to