HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🧚
[1기]최종 프로젝트 데브코스
/
📜
[팀13] 사각사각 ✏️
/
🎊
기술 문서
/
🔮
Jacoco 적용
🔮

Jacoco 적용

plugins { id 'org.springframework.boot' version '2.6.0' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' id "org.flywaydb.flyway" version "8.1.0" id 'jacoco' // 새로 추가! } jacoco { toolVersion = "0.8.7" } test { finalizedBy 'jacocoTestReport' } jacocoTestReport { reports { html.enabled true csv.enabled false xml.enabled false } finalizedBy 'jacocoTestCoverageVerification' } jacocoTestCoverageVerification { violationRules { rule { enabled = true element = 'CLASS' // includes = [] limit { counter = 'LINE' value = 'COVEREDRATIO' minimum = 0.5 } excludes = [] } rule { } } }
The JaCoCo Plugin
To get started, apply the JaCoCo plugin to the project you want to calculate code coverage for. If the Java plugin is also applied to your project, a new task named jacocoTestReport is created. By default, a HTML report is generated at$buildDir/reports/jacoco/test.
The JaCoCo Plugin
https://docs.gradle.org/current/userguide/jacoco_plugin.html
The JaCoCo Plugin
좌충우돌 jacoco 적용기
백기선님의 더 자바 강의를 보던 중 바이트 코드를 다루는 방법의 예시로 jacoco가 언급되었고 테스트 커버리지를 측정하여 build를 성공, 실패 시킬수 있다는 점을 알게되었습니다. 이를 이용하여 ''스터디에서 진행하는 장기 프로젝트와 토이 프로젝트에 적용하면 재미있겠다!' 라는 생각에 적용하며 겪은 내용을 정리해 보고자 합니다! 단순히 적용하는 것은 어렵지 않았습니다!
좌충우돌 jacoco 적용기
https://bottom-to-top.tistory.com/36
좌충우돌 jacoco 적용기
현재 50%를 넘어야 Build 가능 → 점차 80-90%로 늘리기👍👍
counter 협의 필요.
notion image