-
Notifications
You must be signed in to change notification settings - Fork 10
Usage
Gahan Rakholia edited this page Oct 7, 2018
·
6 revisions
The basic usage will use all the default values as describled in the Goals.
<project>
...
<build>
<plugins>
<plugin>
<groupId>io.github.handofgod94</groupId>
<artifactId>jacoco-badge-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
</plugins>
</build>
...
</project>
Here, if nothing is specified, the plugin will be bound to verify
phase.
It is also assumed that jacoco.csv
report is availbe during the exectuion of the phase.
To generage png
or jpg
badges all you have to do is specify correct extension in outputFile
config.
<project>
...
<build>
<plugins>
<plugin>
<groupId>io.github.handofgod94</groupId>
<artifactId>jacoco-badge-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>generate-badge</id>
<phase>post-site</phase>
<configuration>
<outputFile>${project.build.directory}/coverage.png</outputFile>
</configuration>
<goals>
<goal>badge</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
If unknown format is specified then by default
svg
badge will be generated.
You can specify coverageCategory
enum to calculate and generate badges for different category from jacoco
report.
See goals for more info on different category options available.
<project>
...
<build>
<plugins>
<plugin>
<groupId>io.github.handofgod94</groupId>
<artifactId>jacoco-badge-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>generate-badge</id>
<phase>post-site</phase>
<configuration>
<!-- Refer Goals page to know all the parameters that can be specified -->
<coverageCategory>METHOD</coverageCategory>
<outputFile>${project.build.directory}/coverage.png</outputFile>
</configuration>
<goals>
<goal>badge</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>