Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/khmarbaise/example-jacoco

Example Project to setup JaCoCo
https://github.com/khmarbaise/example-jacoco

integrationtesting jacoco-plugin maven maven-4 maven-plugins unittesting

Last synced: 3 months ago
JSON representation

Example Project to setup JaCoCo

Awesome Lists containing this project

README

        

# JaCoCo Example

This example project is related to a [blog article](https://blog.soebes.io/posts/2023/10/2023-10-26-maven-jacoco-configuration/)
which describes the configuration to use JaCoCo in your [Apache Maven project][apache-maven].

Also you can find the article on https://khmarbaise.medium.com/apache-maven-jacoco-configuration-ea3cb592159f

## Requirements

* JDK21+
* Apache Maven 3.8+ (also Maven 4.0.0-alpha-12+ supported).

The given code example can easily being changed to work with JDK version less than 17,
because you can simply replace the given `record` in the example with a usual
final class implemented in the classical way.

## JaCoCo Report

To create a full JaCoCo coverage report you could start via:

```bash
mvn clean verify
```

Creating a report which covers only the unit tests can be achieved by:

```bash
mvn clean verify -DskipITs
```

If you like to have the integration test reports only:

```bash
mvn clean verify -DskipUTs
```

[apache-maven]: https://maven.apache.org