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

Clover-Plugin NullPointer exception on build when <failingTarget> config is missing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • clover-plugin
    • None

      Clover Plugin throws an NPE on build.. find exception below. Our team was able to debug the issue and it was due to missing <failingTarget> config for clover publisher because the failing target fields were not populated. As you can see, this error is not helpful and it would be nice if the log can be more helpful in case of a missing config.

      The NPE happens exactly at this line in CloverPublisher.java
      Set<CoverageMetric> failingMetrics = failingTarget.getFailingMetrics(result);
      where failingTarget is null.. well because it was not provided in the xml config.

      Disclaimer: I have not developed jenkins plugins before so I appologize if I'm not using correct terms.

      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at hudson.plugins.clover.CloverPublisher.processCloverXml(CloverPublisher.java:250)
      at hudson.plugins.clover.CloverPublisher.performImpl(CloverPublisher.java:202)
      at hudson.plugins.clover.CloverPublisher.perform(CloverPublisher.java:160)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:764)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:724)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
      at hudson.model.Run.execute(Run.java:1769)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:374)

            marekparf Marek Parfianowicz
            ahmedmusallam Ahmed Musallam
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: