Skip to content
Gahan Rakholia edited this page Oct 2, 2018 · 7 revisions

Contents

Introduction

Jacoco Coverage Badge is a maven plugin which gives user the ability to generate coverage badges locally in svg,png or jpg format. Local badges are useful in scenarios where you don't want to use hosted services to get information, and just wanted to provide a small badge info in READMEs of projects.
Jacoco is a java utility which when attached to java build tools such as Maven, Gradle or Ant, can generate coverage report.
This plugin is for generating coverage badges from these reports.

  • It generates local badges during build time, so gets updated every time, even when ran in a local machine
  • If user runs the build locally, then badges will be updated with latest coverage information i.e. provides ability to have coverage badge for each fork/branch.

It doesn't mean that everyone should use this plugin to generate badges. Cloud services providing these services are quite good and are quite handy in whatever they are providing. It depends on you, whehter you want local coverage badges or badges provided by cloud services.

Goals

It provides one single goal: badge, which generates badges by reading it from jacoco csv reports.
By default it is bound to veify phase, but user can also bind it to post-site since jacoco reports can also be generated by mvn site command.
Checkout Goals for more infomration.

Please make sure you have jacoco csv report before executing this goal.

Usage

General instruction on how to use Jacoco Coverage Badge plugin can be found in usage page.
Checkout the color mappings to know more on how these colors are mapped to coverage percentages.

In case you have any queries regarding it, you can drop me a mail on gahan94rakh@gmail.com.

If you feel like plugin is missing certain feautures or has bug, you can and create issue for it, here in the same repository. Just go through Contributing Guidlines once to know more information. Also you can directly use Issue Templates for raising issue and follow the checklist from the templates.

Clone this wiki locally