Uploaded image for project: 'Maven POMs (Moved to GitHub issues) '
  1. Maven POMs (Moved to GitHub issues)
  2. MPOM-264

Parameterize maven-compiler-plugin with parameter "release" when running on JDK 9+

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • ASF-23
    • ASF-32
    • asf
    • None

    Description

      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 configures 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 while the latter only supports 6, 7 and 8.

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: