문제 발생
IntelliJ에서 SpringBoot 프로젝트를 실행하는 도중에 "error: cannot find symbol"와 같은 에러가 발생했다.
원인 분석
symbol: method builder()
위와 같은 에러 로그도 같이 나왔는데 builder()에서의 에러인걸 보니 lombok 관련 문제인 것 같다.
문제 해결
Gradle의 버전이 올라가면서 Lombok 의존성을 추가하는 방법이 바뀌었다.
Gradle 5.x 미만
dependencies {
implementaion 'org.projectlombok:lombok'
}
Gradle 5.x 이상
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
따라서 Lombok 의존성 추가 방법을 'Gradle 5.x 미만'에서 'Gradle 5.x 이상'으로 변경했다.
gradle을 reload 한 후 프로젝트를 다시 실행해 보니 문제없이 실행된다.
참고
https://deeplify.dev/back-end/spring/lombok-required-args-constructor-initialize-error