Maven Compiler Plugin
  1. Maven Compiler Plugin
  2. MCOMPILER-109

JavacCompiler treat localized warning messages as errors

    Details

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

      Description

      This is really a bug in plexus-compiler-javac, not that of a Maven plugin.

      Javac uses localized messages for "error" and "warning" for languages like Japanese, but JavacCompiler.parseModernStream(...) and parseModernError(...) is hard-coded to only understand English words "warning" and "error".

      In particular, in line 535, the code treats any keyword but "warning" as errors, so the Japanese word "警告" (meaning warning) is interpreted as an error.

                  isError = !msg.startsWith( WARNING_PREFIX );
      

      As a fix, I suggest you check the exit code from javac to determine if there were any errors — if it returns 0, treat everything as warnings.

        Issue Links

          Activity

          Mark Thomas made changes -
          Workflow jira [ 12956020 ] Default workflow, editable Closed status [ 12993083 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 22:48:53 UTC 2015 [ 1428274133206 ]
          Mark Thomas made changes -
          Workflow jira [ 12718620 ] Default workflow, editable Closed status [ 12750037 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 09:20:51 UTC 2015 [ 1428225651644 ]
          Benjamin Bentmann made changes -
          Fix Version/s 2.3.2 [ 16731 ]
          Fix Version/s 2.4 [ 16208 ]
          Affects Version/s 2.3.1 [ 16462 ]
          Benjamin Bentmann made changes -
          Resolution Fixed [ 1 ]
          Fix Version/s 2.4 [ 16208 ]
          Assignee Benjamin Bentmann [ bentmann ]
          Status Open [ 1 ] Closed [ 6 ]
          Benjamin Bentmann made changes -
          Link This issue is related to PLXCOMP-154 [ PLXCOMP-154 ]
          Juven Xu made changes -
          Field Original Value New Value
          Link This issue relates to MCOMPILER-129 [ MCOMPILER-129 ]
          Kohsuke Kawaguchi created issue -

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Kohsuke Kawaguchi
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development