[SpringBoot] error: variable name not initialized in the default constructor private final String name;

Dev.choi·2022년 3월 29일
0
post-thumbnail

스프링 부트와 AWS로 혼자 구현하는 웹 서비스라는 책을 보며 73p 공부하고 있던 중.. 롬복 dependency 추가하고 코드 돌리니까

error: variable name not initialized in the default constructor private final String name;

에러가 났다. 분명 롬복으로 @Getter로 get메소드, @RequiredArgsConstructor 로 디폴트 생성자 구현 해줬는데..구글링 결과

✔️gradle version 5.x 미만

dependencies {
  implementation 'org.projectlombok:lombok'
}

✔️gradle version 5.x 이상

dependencies {
  compileOnly 'org.projectlombok:lombok'
  annotationProcessor 'org.projectlombok:lombok'
}

참고자료

[스프링/Spring] Lombok: variable not initialized in the default constructor
p.72 lombok constructor 생성 오류

profile
웹앱 공부 중입니다.

0개의 댓글