JaCoCo Training — Java Code Coverage, Quality Gates & CI/CD Integration
Master JaCoCo for Java code coverage: Maven/Gradle integration, coverage thresholds, SonarQube integration, and CI/CD quality gates. The industry standard for Java code coverage analysis.
What Is JaCoCo?
JaCoCo (Java Code Coverage) is the de facto standard code coverage library for Java. It provides bytecode instrumentation (on-the-fly or offline), measures line, branch, instruction, method, and class coverage, and generates reports in multiple formats (HTML, XML, CSV). JaCoCo is the default code coverage engine for Maven (maven-surefire-plugin), Gradle, and SonarQube. If you're measuring Java code coverage in any modern context, you're almost certainly using JaCoCo — whether you know it or not.
DevSecOps & Quality Gate Relevance
JaCoCo is the coverage data provider for quality gates. SonarQube reads JaCoCo's XML reports to enforce coverage thresholds in Quality Gates. Jenkins displays JaCoCo coverage trends. GitHub Actions PR checks show coverage changes. In DevSecOps, code coverage is a first-order metric — "does our test suite actually execute this code?" — and JaCoCo provides the measurement infrastructure for that question.
Who Should Attend
- Java developers who want to measure and improve test coverage
- DevOps engineers integrating coverage into CI/CD quality gates
- Test engineers building quality enforcement pipelines
- Teams migrating from Cobertura to JaCoCo
Learning Outcomes
- Configure JaCoCo in Maven and Gradle builds for line, branch, and instruction coverage
- Generate and interpret JaCoCo reports (HTML, XML, CSV)
- Set and enforce coverage thresholds in CI/CD — build fails if coverage drops
- Integrate JaCoCo with SonarQube for unified quality visibility
- Exclude generated code, configuration classes, and other non-testable code from coverage metrics
- Plan Cobertura→JaCoCo migration with coverage validation
Course Modules
- JaCoCo Fundamentals — Bytecode instrumentation. Coverage counters (instructions, branches, lines, methods, classes).
- JaCoCo with Maven — jacoco-maven-plugin. prepare-agent, report, check goals. Coverage thresholds. Exclusion rules.
- JaCoCo with Gradle — jacoco plugin. jacocoTestReport. jacocoTestCoverageVerification. Exclusion rules.
- JaCoCo in CI/CD — Jenkins JaCoCo plugin. GitHub Actions coverage summary. Build break on low coverage.
- JaCoCo + SonarQube — Report path configuration. Quality Gate coverage conditions. Coverage trend monitoring.
- Migration: Cobertura to JaCoCo — Plugin swap. Coverage comparison. Avoiding coverage drops during migration.
Hands-on Labs (10 total)
Configure JaCoCo in a Maven multi-module project with per-module coverage thresholds. Set up JaCoCo with Gradle and custom exclusion rules. Integrate JaCoCo reports with SonarQube Quality Gate. Build a Jenkins pipeline that fails on coverage below 80%. Migrate a Cobertura project to JaCoCo with identical coverage validation.
Enterprise Use Cases
- Enforcing 80% line and branch coverage across 100+ Java microservices with build-time gates
- Integrating JaCoCo with SonarQube for organization-wide coverage visibility and trend tracking
- Migrating legacy Cobertura coverage infrastructure to JaCoCo with zero coverage metric disruption
Related Courses
See Cobertura Training, SonarQube Training, and DevSecOps Engineering.
TOOLS_COVERED
PREREQUISITES
- Java development experience
- Maven or Gradle basic knowledge
CURRICULUM
READY TO UPSKILL YOUR ENGINEERING TEAM?
Browse our training catalog, check upcoming cohorts, and enroll in the program that fits your transformation goals.
FIND YOUR TRAINING PATHOnline · Classroom · Corporate · Self-paced · Certification-aligned