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

NullPointerException when running JacocoPublisher

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • jacoco-plugin
    • Jenkins 2.16
      Jacoco 2.1.0-beta1

      Running this in my pipeline

      step([$class: 'JacocoPublisher', execPattern:'build/jacoco/jacoco.exec', classPattern: 'build/classes/main', sourcePattern: 'src/main/java', exclusionPattern: '**/*Test.class'])
      

      I end up getting the following NPE :

      [JaCoCo plugin] Collecting JaCoCo coverage data...
      [JaCoCo plugin] build/jacoco/jacoco.exec;build/classes/main;src/main/java; locations are configured
      [JaCoCo plugin] Number of found exec files for pattern build/jacoco/jacoco.exec: 1
      [JaCoCo plugin] Saving matched execfiles:  /var/lib/jenkins/jobs/BITBUCKET_TEAM_PROJECT/jobs/GIT_PROJECT/branches/v0.0.3/workspace/build/jacoco/jacoco.exec
      [JaCoCo plugin] Saving matched class directories for class-pattern: build/classes/main:  /var/lib/jenkins/jobs/BITBUCKET_TEAM_PROJECT/jobs/GIT_PROJECT/branches/v0.0.3/workspace/build/classes/main
      [JaCoCo plugin] Saving matched source directories for source-pattern: src/main/java:  /var/lib/jenkins/jobs/BITBUCKET_TEAM_PROJECT/jobs/GIT_PROJECT/branches/v0.0.3/workspace/src/main/java
      [JaCoCo plugin] Loading inclusions files..
      [JaCoCo plugin] inclusions: []
      [JaCoCo plugin] exclusions: [**/*Test.class]
      [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
      [JaCoCo plugin] Publishing the results..
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      [Bitbucket] Notifying commit build result
      [Bitbucket] Build result notified
      java.lang.NullPointerException
      	at hudson.plugins.jacoco.JacocoBuildAction.getJacocoReport(JacocoBuildAction.java:204)
      	at hudson.plugins.jacoco.JacocoBuildAction.getResult(JacocoBuildAction.java:219)
      	at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:490)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:68)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:59)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
      	at hudson.security.ACL.impersonate(ACL.java:221)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Finished: FAILURE
      

            ognjenb Ognjen Bubalo
            saiimons Simon GUEROUT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: