Uploaded image for project: 'Maven Compiler Plugin'
  1. Maven Compiler Plugin
  2. MCOMPILER-413

Parameters does not work when only release is specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.8.1
    • 3.9.0
    • None
    • Arch Linux, OpenJDK 11.0.6.u10, Maven 3.6.3

    Description

      Compiling a project with the following maven-compiler-plugin configuration does not produce parameter name metadata in the class files:

      <configuration>
          <release>9</release>
          <parameters>true</parameters>
      </configuration>

      I believe this is a mistake, because
      javac --release 9 -parameters Test.java
      will produce the metadata.

      This behavior is due to dependency org.codehaus.plexus:plexus-compiler-javac:2.8.4, where in org.codehaus.plexus.compiler.javac.JavacCompiler, line 312, the function isPreJava18 is called. This function does not evaluate the release property, only source and compilerVersion.

      Available workarounds in pom.xml are additionally specifying source or explicitly specifying the -parameters parameter in the plugin configuration.

       

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              jiri.kraml.zigpos Jiri Kraml
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: