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

          cristalp created issue -

          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 made changes -
          Epic Link New: JENKINS-56456 [ 198054 ]
          Ulli Hafner made changes -
          Component/s New: analysis-model [ 23523 ]
          Component/s Original: analysis-model-api-plugin [ 24221 ]
          Labels New: help-wanted newbie-friendly
          Ulli Hafner made changes -
          Assignee Original: Ulli Hafner [ drulli ]
          Tobias Schaffner made changes -
          Assignee New: Tobias Schaffner [ tschaffn ]
          Ulli Hafner made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Ulli Hafner made changes -
          Rank New: Ranked higher

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - See https://github.com/jenkinsci/analysis-model/pull/136
          Ulli Hafner made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]

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

              Created:
              Updated:
              Resolved: