variable name not initialized in the default constructor
SpringBoot를 책보며 공부중인데 변수 초기화 에러가 뜬다.
@Getter // 선언된 모든 필드의 get 메소드를 생성해준다.
@RequiredArgsConstructor // 선언된 모든 final 필드가 포함된 생성자를 생성해준다. (final 안붙어있으면 포함x)
public class HelloResponseDto {
private final String name;
private final int amount;
}
위와 같이하면 final 변수들은 생성자에 추가해서 그런 오류가 생기지 않을텐데?
라고 멘붕하고 있었는데, 다행이 잘 정리 해주신 고수님 덕분에 에러를 해결할 수 있었다.
https://tube-life.tistory.com/14
gradle @Test error: variable not initialized in the default constructor
작업자의 작업 환경 - Intellij - Windows 10 HelloResponseDto.java import lombok.Getter; import lombok.RequiredArgsConstructor; @Getter @RequiredArgsConstructor public class HelloResponseDto { private..
tube-life.tistory.com
오류가 발생할 경우. build.gradle 파일에 대해 아래와 같이 추가한다.
//기존
compile('org.projectlombok:lombok')
//추가
testCompile "org.projectlombok:lombok"
annotationProcessor('org.projectlombok:lombok')
testAnnotationProcessor('org.projectlombok:lombok')
'개발 > Web Programming' 카테고리의 다른 글
[React Native] expo not found (0) | 2020.07.12 |
---|---|
intellij 에서 plugin 창 열고 설치하기 (0) | 2020.01.15 |
SpringBoot Caused by: java.lang.IllegalStateException 에러? (0) | 2020.01.10 |
intellij Community 무료버젼으로 스프링부트 프로젝트 실행하기 (0) | 2020.01.10 |
@RunWith can not resolve? (0) | 2020.01.09 |