Jenkins and JaCoCo with sbt Jenkins and JaCoCo with sbt jenkins jenkins

Jenkins and JaCoCo with sbt


I was running into this same issue when trying to start a new Scala project. After trying a number of path configurations, I was able to figure a solution.

The default value for Path to class directories is **/classes. I suspect the issue is that the pattern allows for matching target/scala-X.XX/classes/ and target/scala-X.XX/jacoco/classes/.

Changing the class directory path to target/*/classes allowed the Jenkins plug-in to start reporting the correct coverage information.


You didn't give much information about your Jenkins job configuration, so I'm making some assumptions, but you can add/execute multiple build steps in a Jenkins job. Build steps run things like run Maven or run any arbitrary script.

The first build step can be a Maven build step that executes "jacoco:test jacoco:report" to run Jacoco and then the second build step can be whatever else you run that is looking for the jacoco.exec file.