Skip to content
/ jcc2c Public

A tool to convert JaCoCo XML coverage reports to Cobertura XML coverage reports.

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
license-header.txt
Notifications You must be signed in to change notification settings

cjmach/jcc2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jcc2c

A tool written in Java to convert JaCoCo XML coverage reports to Cobertura XML coverage reports. We also provide the same tool written in Nashorn Javascript (found here), but bear in mind that Nashorn engine was deprecated in JDK 11 (and removed in JDK 15), in favor of GraalVM Javascript.

jcc2c is still a necessity in case you are using tools or services that only support Cobertura XML reports. The implementation was inspired by cover2cover project, but jcc2c is more appropriate to use in Java development environments, since there's no need to install Python just to run cover2cover script.

Usage

$ java -jar jcc2c.jar -h
Usage: jcc2c [-hv] -i=FILE -o=FILE [SOURCE DIR...]
      [SOURCE DIR...]   One or more source directories.
  -h, --help            Print help and exit.
  -i, --input=FILE      Path to JaCoCo XML coverage report input file. If set
                          to '-', input will be read from stdin. Required 
                          option.
  -o, --output=FILE     Path to Cobertura XML coverage report output file. If
                          set to '-', output will be written to stdout. Required 
                          option.
  -v, --version         Print version and exit.

Example:

$ java -jar jcc2c.jar -i jacoco-report.xml -o cobertura-report.xml src/main/java

Building

To build this project you need:

  • Java Development Kit 11
  • Apache Maven 3.6.x or above

Assuming all the tools can be found on the PATH, simply go to the project directory and run the following command:

$ mvn -B package

Releasing

Go to the project directory and run the following commands:

$ mvn -B release:prepare
$ mvn -B release:perform -Darguments='-Dmaven.deploy.skip=true' 

It will automatically assume the defaults for each required parameter, namely, releaseVersion and developmentVersion. If it's necessary to control the values of each version, the release:prepare command can be run as follows:

$ mvn -B release:prepare -DreleaseVersion={a release version} -DdevelopmentVersion={next version}-SNAPSHOT