티스토리 뷰
1. jacoco plugin 추가
......
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
......
2. Maven clean
3. Maven Install
4. \target\site\jacoco\index.html 브라우저로 열기
Unsupported class file major version 61 뜰 경우
class가 java17 또는 그 이상으로 컴파일 됐는데,
무슨이유인진 모르겠지만 이거때매 안되는거라함.
그래서 컴파일 하는 java의 버전을 낮춰서 다시 class파일이 만들어지도록 함.
1. 버전 낮추기 - pom.xml java버전을 11로 바꿈
2. maven clean
3. maven install
중간중간 로고에 Unsupported class file major version 61 가 뜨긴 한데, 해당 class는 분석하려는 class가 아닌가봄.
test케이스가 많이 커버될수록 초록색이 많이 차오르나봄.
test케이스를 더 많이 추가해봐야 겠음.
spring boot 3 에서
위와 같이 (정확히는 0.8.4 버전)으로 spring boot 3(최소 java17)에서 실행 했을 시,
콘솔창에 로그가 미친들이 올라감. 계속 올라감. 끝나지 않음.
ctrl+c로 멈추고 로그를 살펴보면
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
라고 뜰 텐데, java17에서는 support가 안돼나 봄.
그래서 검색 해보니, 사이트 하나 발견. jacoco.org 사이트였음.
https://www.jacoco.org/jacoco/trunk/doc/changes.html
JaCoCo - Change History
Change History Snapshot Build 0.8.11.202305220548 (2023/05/22) Fixed bugs Instrumentation should not cause VerifyError when the last local variable of method parameters is overridden in the method body to store a value of type long or double (GitHub #893).
www.jacoco.org
읽다 보니, 0.8.8 부터 java17, java18을 지원한다고 되어 있음.
버전만 0.8.8로 바꾼 후 돌려보면 돌아감
'spring(boot)' 카테고리의 다른 글
[microservices]2.소스 추가 (0) | 2023.01.31 |
---|---|
[microservices]1.프로젝트 기본 뼈대(총 5개 프로젝트) (0) | 2023.01.30 |
[security]jwt (+react) (0) | 2022.11.16 |
[java]parameter로 method 넘기기 (0) | 2022.10.30 |
[boot]Scheduling: method를 주기적으로 실행시키려면? (0) | 2022.10.26 |