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

JavacCompiler treat localized warning messages as errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1
    • 2.3.2
    • 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.

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              kohsuke Kohsuke Kawaguchi
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: