jacoco-coverage-policy

Enforce JaCoCo line and branch coverage thresholds in Maven builds.

50|7|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill jacoco-coverage-policy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jacoco-coverage-policy
Source: https://github.com/loiane/specs-driven-development-spring-angular/tree/main/.windsurf/skills/jacoco-coverage-policy
Command: npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill jacoco-coverage-policy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

JaCoCo coverage policy defines and enforces minimum and target coverage thresholds (line and branch) for Maven-based projects, helping maintain code quality and ward off regressions across the codebase.

Core Features & Use Cases

  • Policy-driven gates: floors at 90% and targets at 95% (and 95% on new code) for line and branch coverage.
  • Configurable integration: easily wired into Maven builds via jacoco-maven-plugin with dedicated check rules.
  • Use Case: On brownfield onboarding, establish a baseline and progressively improve coverage as changes are introduced.

Quick Start

Configure the JaCoCo Maven plugin with the policy and run your build to enforce coverage gates.

Frequently Asked Questions about jacoco-coverage-policy

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

FAQPage Schema
How do I enforce JaCoCo code coverage thresholds in a Maven build?

To prevent code coverage regressions in Maven, configure the jacoco-maven-plugin with check rules that enforce minimum line and branch coverage floors, causing the build to fail when thresholds are not met.

What is a JaCoCo coverage policy and when do I need it?

A JaCoCo coverage policy establishes minimum and target line and branch coverage thresholds to maintain code quality. It is needed when you want to prevent coverage regressions across your entire codebase or on newly added code.

Can I enforce different coverage thresholds for new code versus the existing codebase?

Yes, you can configure separate coverage validation rules. The policy can validate line and branch coverage on the entire codebase against an overall floor while applying different target thresholds specifically to newly added code.

Do I need the JaCoCo Maven plugin to set up coverage gates?

Yes, the jacoco-maven-plugin is required. You must have the plugin and the policy configuration present in your Maven project to validate coverage against defined thresholds and emit the structured validation report.

How do I establish a coverage baseline during brownfield onboarding?

For brownfield onboarding, configure the JaCoCo Maven plugin to set coverage floors at a baseline and progressively apply higher target thresholds to newly introduced changes to improve code quality over time.

Why does my Maven build fail when JaCoCo coverage drops?

Your Maven build fails because the JaCoCo coverage policy validates line and branch metrics against configured floors. If newly added or existing code drops below these thresholds, the gate prevents the regression.