When you produce JaCoCo code coverage data as part of a build or build pipeline, you can
use the ccconvert.sh script to collect and convert the JaCoCo code coverage data
into a .cczip file that can be imported and viewed in the Code
Coverage Results view.
About this task
You can find the ccconvert.sh script in directory
/usr/lpp/IBM/debug/headless-code-coverage/bin/.
Procedure
Identify the directories that contain the JaCoCo execution data (.exec
files), the directories that contain the Java class files, and optionally the directories that
contain the Java source files.
Note: The version of the Java .class files must be the same as those that were
used to produce the JaCoCo .exec files. If the version is mismatched, code
coverage data for the affected classes cannot be produced.
Run the ccconvert.sh command from z/OS UNIX.
The syntax
diagram for the ccconvert.sh command is shown below. You can use either the single
letter parameter or the complete one for each option. All parameters and values are
case-sensitive.
Options list
Format: ccconvert.sh [options]
-o,outputpath=<path>
Specifies the directory to save the converted JaCoCo code coverage data. A
.cczip file with a timestamp is created under the output directory.
-x,jacocoexeclocation=<paths>
Specifies paths to search for JaCoCo .exec files. You can specify more than
one path by using the system path separator between values. On z/OS, the path separator is colon
(:). Directories are searched recursively.
-c,jacococlasslocation=<paths>
Specifies paths to search for Java .class files. You can specify more than
one path by using the system path separator between values. On z/OS, the path separator is colon
(:). Directories are searched recursively.
-s,jacocosrclocation=<paths>
Optional: Specifies paths to search for Java source files. You can specify more than one path by
using the system path separator between values. On z/OS, the path separator is colon (:).
Directories are searched recursively.
-u,jacocosourceencoding=<encoding>
Optional: Specifies an encoding for the source files.
-h,help
Prints the help screen.
What to do next
You can import the .cczip file into the Code Coverage
Results view and work with the imported results.