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

NullPointerException using Cpplint parser in warnings plugin on console log.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I want to use the warnings plugin to display results of cpplint from the console.
      I am getting the following exception:

      ERROR: Publisher hudson.plugins.warnings.WarningsPublisher aborted due to exception
      java.lang.NullPointerException
      at hudson.plugins.violations.util.AbsoluteFileFinder.addSourcePaths(AbsoluteFileFinder.java:20)
      at hudson.plugins.violations.types.cpplint.CppLintParser.parse(CppLintParser.java:44)
      at hudson.plugins.warnings.parser.ViolationsAdapter.parse(ViolationsAdapter.java:60)
      at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:317)
      at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:296)
      at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:293)
      at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:257)
      at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:338)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:678)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:656)
      at hudson.model.Build$RunnerImpl.post2(Build.java:162)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:625)
      at hudson.model.Run.run(Run.java:1433)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:238)

      I am using warnings plugin 4.5 and violations plugin 0.7.10.
      If you need any further information, please ask.

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          Are there relative paths in the result file? Can you please attach your cpplint result?

          Show
          drulli Ulli Hafner added a comment - Are there relative paths in the result file? Can you please attach your cpplint result?
          Hide
          fep2k Fabian Pachner added a comment -

          There are no relative paths. Attached the file from console output. As you can see I am parsing the console output for MSBuild warnings AND cpplint warnings together. Perhaps this helps. Thank you!

          Show
          fep2k Fabian Pachner added a comment - There are no relative paths. Attached the file from console output. As you can see I am parsing the console output for MSBuild warnings AND cpplint warnings together. Perhaps this helps. Thank you!
          Hide
          drulli Ulli Hafner added a comment -

          Thanks, seems that the format is quite simple. I think that I will rather write a new parser than using the violations plug-in in your case. That will also add slave support.

          Show
          drulli Ulli Hafner added a comment - Thanks, seems that the format is quite simple. I think that I will rather write a new parser than using the violations plug-in in your case. That will also add slave support.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/parser/CppLintParser.java
          src/main/java/hudson/plugins/warnings/parser/ViolationsRegistry.java
          src/test/java/hudson/plugins/warnings/parser/CppLintParserTest.java
          src/test/resources/hudson/plugins/warnings/parser/cpplint.txt
          http://jenkins-ci.org/commit/warnings-plugin/888b0dc8a090e1d7d6b2d9a1d18ae05250bed7e4
          Log:
          [FIXED JENKINS-14018] Added new parser for C++ Lint.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/parser/CppLintParser.java src/main/java/hudson/plugins/warnings/parser/ViolationsRegistry.java src/test/java/hudson/plugins/warnings/parser/CppLintParserTest.java src/test/resources/hudson/plugins/warnings/parser/cpplint.txt http://jenkins-ci.org/commit/warnings-plugin/888b0dc8a090e1d7d6b2d9a1d18ae05250bed7e4 Log: [FIXED JENKINS-14018] Added new parser for C++ Lint.
          Show
          drulli Ulli Hafner added a comment - - edited Can you please verify the priority mapping in https://github.com/jenkinsci/warnings-plugin/blob/888b0dc8a090e1d7d6b2d9a1d18ae05250bed7e4/src/main/java/hudson/plugins/warnings/parser/CppLintParser.java
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/parser/CppLintParser.java
          http://jenkins-ci.org/commit/warnings-plugin/b1a8e1b8a60573aa10e945d542d71f8a15846b33
          Log:
          JENKINS-14018 Typo.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/parser/CppLintParser.java http://jenkins-ci.org/commit/warnings-plugin/b1a8e1b8a60573aa10e945d542d71f8a15846b33 Log: JENKINS-14018 Typo.
          Hide
          fep2k Fabian Pachner added a comment -

          The priority mapping isn't important for me. Perhaps anyone else can verify this. Thanks for fixing this in a very fast and uncomplicated way! In which update will this be released?

          Show
          fep2k Fabian Pachner added a comment - The priority mapping isn't important for me. Perhaps anyone else can verify this. Thanks for fixing this in a very fast and uncomplicated way! In which update will this be released?
          Hide
          drulli Ulli Hafner added a comment -

          It will be part of the next release. You can get a pre-release version from my CI server, see WIKI for the address.

          Show
          drulli Ulli Hafner added a comment - It will be part of the next release. You can get a pre-release version from my CI server, see WIKI for the address.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              fep2k Fabian Pachner
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: