jacoco-ci-setup

Configure JaCoCo coverage thresholds and GitHub Actions CI pipelines for Spring Boot projects.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/heiherilala-vawd/ompany-Management --skill jacoco-ci-setup-heiherilala-vawd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jacoco-ci-setup
Source: https://github.com/heiherilala-vawd/ompany-Management/tree/main/.agents/skills/jacoco-ci-setup
Command: npx skills add https://github.com/heiherilala-vawd/ompany-Management --skill jacoco-ci-setup-heiherilala-vawd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up code coverage reporting, coverage thresholds, and a CI pipeline in a Spring Boot Gradle project involves many scattered configuration details across build.gradle.kts and GitHub Actions workflows, which is error-prone when done manually. ## Core Features & Use Cases - JaCoCo Configuration: Adds the JaCoCo plugin, exclusion patterns, HTML/XML reports, and line/branch coverage thresholds to build.gradle.kts. - GitHub Actions CI: Provides complete workflow files with PostgreSQL service containers, Testcontainers support, and artifact uploads for coverage and test reports. - Quality Tooling Integration: Includes Checkstyle, Spotless, and optional SonarQube/SonarCloud setup with CI jobs and README badges. - Use Case: A developer starting a new Spring Boot API wants enforced 50% line coverage, automated tests on every pull request, and SonarCloud analysis without writing the Gradle and YAML configuration from scratch. ## Quick Start Set up JaCoCo coverage with thresholds and a GitHub Actions CI pipeline in my Spring Boot Gradle project.

Frequently Asked Questions about jacoco-ci-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up JaCoCo code coverage in a Spring Boot Gradle project?

Apply the jacoco plugin in build.gradle.kts, configure jacocoTestReport for HTML and XML output, and add jacocoTestCoverageVerification with line and branch ratio thresholds. Bind the report to test tasks and verification to the check task.

How to create a GitHub Actions CI pipeline for Spring Boot with PostgreSQL?

Define a workflow triggered on push and pull requests, set up JDK 21 with the setup-java action, and run a PostgreSQL service container with health checks. Pass the datasource URL and credentials as environment variables to the Gradle build step.

Does JaCoCo work with Testcontainers in GitHub Actions?

Yes, JaCoCo works with Testcontainers in CI. Add the docker/setup-buildx-action step and omit the PostgreSQL service block, since Testcontainers manages its own containers during the test run.

How do I exclude generated code from JaCoCo coverage reports?

Define exclusion patterns such as **/client/**, **/model/**, **/dto/**, and **/config/**, then apply them to classDirectories in both jacocoTestReport and jacocoTestCoverageVerification tasks using fileTree matching.

Why does my JaCoCo coverage verification fail in CI?

Verification fails when line or branch coverage falls below the configured minimums, such as 0.50 line and 0.40 branch ratios. Check the HTML report in build/reports/jacoco to identify uncovered classes and add tests or adjust exclusions.