Issue
Can anyone suggest if there is a way to execute Jacoco in a Jenkins Pipeline? I have downloaded the plugin but I do not get the option for Jacoco in the 'Pipeline Syntax', which is the Pipeline script help .
Referred this URL: https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin which has no information for a jenkins jacoco pipeline
Solution
After trying to scour the internet for a simple example of how to do this, I eventually found the "step" tool within our Jenkins instance.
It knows how to generate snippets of Jenkinsfile pipeline code based on the plugins and modules you have installed.
The long and short of it is that the basic entry looks like:
stage('Build') {
steps {
sh './jenkins_build.sh'
junit '*/build/test-results/*.xml'
step( [ $class: 'JacocoPublisher' ] )
}
}
The jenkins documentation really needs an update with some one-liner examples.
Answered By - Jeffrey Zampieron