You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/06/17 15:10:00 UTC

[jira] [Created] (MPOM-264) Parameterize maven-compiler-plugin with "release" when running on JDK 9+

Konrad Windszus created MPOM-264:
------------------------------------

             Summary: Parameterize maven-compiler-plugin with "release" when running on JDK 9+
                 Key: MPOM-264
                 URL: https://issues.apache.org/jira/browse/MPOM-264
             Project: Maven POMs
          Issue Type: Improvement
          Components: asf
    Affects Versions: ASF-23
            Reporter: Konrad Windszus


Instead of using {{source}} and {{target}} the new parameter {{release}} (https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release) should be used with Java 9+ as that also checks whether the used API is provided in the target Java release (https://docs.oracle.com/javase/9/tools/javac.htm#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9__GUID-D343F6B4-3FDD-43A8-AD24-43DD70214471).

To be able to support both compilation with Java < 9 and above a profile should be used which either configured {{source}} and {{target}} or {{release}}. 
You have  to observe though that the parameter values are different though, as the former supports 1.6, 1.7 and 1.8 the latter only supports 6, 7 and 8.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)