Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56737

Java compiler warnings parser can't cope with Maven timestamps in log

    • 5.0.0 (analysis-model and warnings-ng)

      We switched on Maven timestamps in our log, since it's a handy way to check build times.

      In Maven, this is done by editing conf/logging/simplelogger.properties and setting org.slf4j.simpleLogger.showDateTime=true

      This results in compiler warnings like this:

      08:52:34.395 [WARNING] /my/path/to/workspace/src/main/java/my/package/TemporalJsonSeqFiling.java:[86,76] redundant cast to long
      

      ( given that the date/time format is org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss.SSS )

      Taking a look at the source code, it seems that JAVAC_WARNING_PATTERN does a full match of the line, which does not accept that something could exist before [WARNING] .

      We use other parsers for Checkstyle, PMD etc. and they work fine.

          [JENKINS-56737] Java compiler warnings parser can't cope with Maven timestamps in log

          Ulli Hafner added a comment -

          It does allow something in front of [WARNING] but that must be included in brackets. It is quite hard to solve that in general since the logger format could be changed to something completely different...

          But I think it should be possible to improve that regex to ignore everything before [WARNING].

          Ulli Hafner added a comment - It does allow something in front of [WARNING] but that must be included in brackets. It is quite hard to solve that in general since the logger format could be changed to something completely different... But I think it should be possible to improve that regex to ignore everything before [WARNING] .

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - See https://github.com/jenkinsci/analysis-model/pull/136

          cristalp added a comment -

          Thanks, guys!

          cristalp added a comment - Thanks, guys!

            tschaffn Tobias Schaffner
            cristalp cristalp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: