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:12:00 UTC
[jira] [Commented] (MPOM-264) Parameterize maven-compiler-plugin
with parameter "release" when running on JDK 9+
[ https://issues.apache.org/jira/browse/MPOM-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17364974#comment-17364974 ]
Konrad Windszus commented on MPOM-264:
--------------------------------------
An example approach for this can be found in https://github.com/apache/sling-parent/blob/9480890829a3a8670d5ba0fcb648de9b598a1c86/sling-parent/pom.xml#L535 and https://github.com/apache/sling-parent/blob/9480890829a3a8670d5ba0fcb648de9b598a1c86/sling-parent/pom.xml#L566
> Parameterize maven-compiler-plugin with parameter "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
> Priority: Major
>
> 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)