# JaCoCo "Rule violated for bundle ... lines covered ratio" in CI

> Fix JaCoCo "Rule violated for bundle X: lines covered ratio is 0.50, but expected minimum is 0.80" in CI - the jacoco:check goal enforced a minimum and coverage fell below it.

Source: https://latchkey.dev/learn/ci-integrations/jacoco-rule-violated-bundle-in-ci  
Updated: 2026-06-30

The Maven jacoco:check (or Gradle jacocoTestCoverageVerification) goal compared measured coverage against a rule limit and the ratio was below the minimum, so the build fails with the exact measured and required values.

## Diagnose it: did the report reach the service?

Coverage and quality integrations fail in two distinct places: the report was never produced, or it was produced and the upload was rejected. Establish which before touching tokens.

```Terminal
# 1. does the report exist and is it non-empty?
ls -la coverage/ && head -5 coverage/lcov.info

# 2. does it reference paths the service can map to the repo?
grep "^SF:" coverage/lcov.info | head -5

# 3. did the upload actually succeed, or just not fail the step?
# most uploaders exit 0 on a rejected upload unless told otherwise
```

> Absolute paths in an lcov report break file mapping on the service side, so coverage appears as zero even though the upload succeeded. Generate reports with paths relative to the repository root.

## FAQ

### What causes JaCoCo "Rule violated for bundle ... lines covered ratio" in CI?

There are 2 common causes: coverage genuinely dropped below the rule limit and the rule scope or counter is stricter than intended. New untested code lowered the covered ratio under the configured minimum (line, branch, or instruction), so the rule fails.

### How do I fix JaCoCo "Rule violated for bundle ... lines covered ratio" in CI?

There are 2 fixes depending on which cause you have: add tests to meet the limit, or adjust the rule and exclude generated code from the rule. Work through them in order, since the first is the most common.

### What does JaCoCo "Rule violated for bundle ... lines covered ratio" in CI actually mean?

The build fails with "Rule violated for bundle X: lines covered ratio is 0.50, but expected minimum is 0.80" and the reactor reports a JaCoCo check failure.

### How do I stop JaCoCo "Rule violated for bundle ... lines covered ratio" in CI happening again?

Run jacoco:check locally before pushing. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
