Complete Guide Integrate JaCoCo Plugin With Your Jenkins Project
Follow the steps mentioned below to integrate the plugin with your jenkins project.
Step 1: Go to the project section and select the project which you want to integrate the the plugin with. Here i am using the jenkins freestyle project so scroll down to the last section of the project there you will find the “Add post build aztion”,As shown in the image below.
Step 2: Once you click on the add post build action there you will find an option called “Record Jacoco Coverage Report” you will find this option when and only you configure the plugin in the jenkins by following the steps mentioned above.
Step 3: After that you will find an section where you need to fill all the the threshhold value. This value will helps you to coverage the code quality to the “80%”. If the code was not reaching this level the build will automatically fail and it will generates complete report of the placeses you need to concentrate.
In the above image you can see that we are selecting the option called “Fail the build if coverege degrades more than the delta thresholds” the build will fail if the code quality was not reaching the threshholds value and also we have selected change “build status according to the defined thresholds”.
Step 4: You can see the console output where it will mentions the build failed reason was jacoco plugin.
Step 5: Jacoco plugin also generate the complete report on the code quality like called “coverage report” you can see the complete report of the code where the developers can concentrate more.
By the steps all the mentioned above you can configure the JaCoCo plugin and integrate with any of your jenkins projects.
What Is JaCoCo Plugin In Jenkins?
The name JaCoCo stands for Java code coverage it will help the developers measure, while testing the code, how much code was executed during the testing of the code. The code that is measured using jaCoCo Plugin is known as code coverage The higher code coverage indicates that a greater portion of your code is being tested.