| 종류 | 환경 |
|---|---|
| IDE | Intellij IDEA 2023.1.2 (Ultimate Edition) |
| 언어 | SpringBoot 3.1.0 |
| 타입 | Gradle - Groovy |
| JDK | corretto-17 |
| 패키지 생성 | Jar |
| 버전관리 | Github |
| 종류 | 이름 |
|---|---|
| Web | Spring web |
| Developer Tools | Spring Processor / Lombok |
| SQL | Spring Data JPA / MySQL Driver |
| 기타 | OpenAPI:2.0.2 / Gson:2.10.1 / Spring test / Jacoco:0.8.7 |
참조 : gradle에서 jacoco 설정하기
https://techblog.woowahan.com/2661/
plugins {
id 'jacoco'
}
jacoco {
toolVersion = "0.8.7"
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/ProductServiceImpl.class"
])
}))
}
reports {
xml.enabled true
csv.enabled true
html.enabled true
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'BUNDLE'
limit {
counter = 'INSTRUCTION'
value = 'COVEREDRATIO'
minimum = 0.8
}
element = 'METHOD'
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 50
}
excludes = ['**/ProductServiceImpl.class']
}
}
}
test {
finalizedBy 'jacocoTestReport'
jacoco {
enabled = true
includes = []
excludes = ['**/ProductServiceImpl.class']
}
}
Gradle -> project명 -> Tasks -> verification -> test 실행

project명 -> build -> reports -> jacoco -> test -> html -> index.html 열기


