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

Incorrect `compilerArgs` example usage

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.2
    • Fix Version/s: 3.8.1
    • Labels:
      None

      Description

      The compilerArgs property documentation contains this example usage:

      <compilerArgs>
        <arg>-Xmaxerrs=1000</arg>
        <arg>-Xlint</arg>
        <arg>-J-Duser.language=en_us</arg>
      </compilerArgs>
      

      But setting <arg>-Xmaxerrs=1000</arg> causes:

      	...
      Caused by: java.lang.IllegalArgumentException: invalid flag: -Xmaxerrs=1000
      	at com.sun.tools.javac.api.JavacTool.processOptions(JavacTool.java:206)
      	at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:156)
      	at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:107)
      	at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:64)
      	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
      	... 16 more
      

      This does work:

      <compilerArgs>
        <arg>-Xmaxerrs</arg>
        <arg>1000</arg>
      </compilerArgs>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olamy Olivier Lamy
                Reporter:
                stephan202 Stephan Schroevers
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: