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

Null pointer exception in Jenkins pipeline when Jacoco plugin is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • jacoco-plugin
    • Jenkins war version: 2.319.1
      Jacoco plugin version: 3.30
      Ubuntu: 20.04
      Java: 1.8

      Jenkins pipeline errors out with Null pointer exception when I am using Jacoco plugin. If I comment out the Jacoco step from Jenkinsfile then there is no error thrown. The log file in Jenkins indicate that the error is thrown after the End of Pipeline. Any idea why this error is thrown?

      Jacoco plugin version: 3.30

      Jenkins war version: 2.319.1

      Stackoverflow: <https://stackoverflow.com/questions/70274194/null-pointer-exception-in-jenkins-pipeline-when-jacoco-plugin-is-used?>

       

      Jenkins log message ....

      {{[Pipeline] // node
      [Pipeline] End of Pipeline
      java.lang.NullPointerException
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:87)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:70)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      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:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE}}

      {{}}

      {{}}

      Jenkins file used ....

       

      {{pipeline{

      agent any

      stages{

      stage('Git clone project'){
      steps

      { git branch: 'sandbox',url:'https://<repo url>' sh 'git branch -a' }

      }

      stage('Test TMS'){
      steps{
      dir('TestManagementService')

      { sh 'pwd' sh './gradlew test' step( jacoco( execPattern: '**/build/jacoco/**.exec', classPattern: '**/build/classes/java/main', sourcePattern: '**/src', inclusionPattern: 'com/testMgmt/**', ) ) }

      }

      post{
      always

      { junit '**/build/test-results/test/TEST-*.xml' }

      }
      }

      }// end of stages

      }}}{{}}

            ognjenb Ognjen Bubalo
            amithksm Amith S M
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: