문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:lombok [2020/07/09 12:40] kwon37xi [Maven 설정] |
java:lombok [2021/02/02 18:44] kwon37xi [1.16.20] |
||
---|---|---|---|
줄 10: | 줄 10: | ||
===== Gradle-Lombok ===== | ===== Gradle-Lombok ===== | ||
* [[https:// | * [[https:// | ||
- | * [[https://github.com/franzbecker/gradle-lombok|gradle-lombok plugin]] | + | * [[https://plugins.gradle.org/plugin/io.freefair.lombok|io.freefair.lombok |
* 혹은 다음과 같이 직접 설정< | * 혹은 다음과 같이 직접 설정< | ||
compileOnly ' | compileOnly ' | ||
줄 81: | 줄 81: | ||
* 1.4 이하 Ant 태스크 : '' | * 1.4 이하 Ant 태스크 : '' | ||
* 1.6 이상 Ant 태스크 : '' | * 1.6 이상 Ant 태스크 : '' | ||
+ | |||
+ | ===== Upgrade 주의점 ===== | ||
+ | * [[https:// | ||
+ | |||
+ | ==== 1.16.20 ==== | ||
+ | * 이 시점 이후부터 '' | ||
+ | * [[https:// | ||
+ | * 기본 생성자가 없을 경우, [[java: | ||
+ | * '' | ||
+ | |||
+ | ==== 1.18.4 field annotation 들이 getter/ | ||
+ | * 1.18.4 이상 버전은 field 에 지정한 '' | ||
+ | * 문제는 기존에 복제를 안해주는 버전으로 응답을 내려줄때, | ||
+ | |||
+ | >> BREAKING CHANGE: Lombok will now always copy specific annotations around (from field to getter, from field to builder ' | ||
+ | |||
+ | === 구버전 === | ||
+ | |||
+ | <code java> | ||
+ | @JsonProperty(" | ||
+ | private int yyy; | ||
+ | |||
+ | -> 진짜 생성은 | ||
+ | |||
+ | @JsonProperty(" | ||
+ | private int yyy; | ||
+ | |||
+ | public void setYyy(int yyy) { | ||
+ | this.yyy = yyy; | ||
+ | } | ||
+ | |||
+ | -> 이로 인해서 JSON 에 XXX, yyy 두개의 필드가 존재하게 됨. | ||
+ | </ | ||
+ | |||
+ | === 신 버전 Lombok === | ||
+ | <code java> | ||
+ | @JsonProperty(" | ||
+ | private int yyy; | ||
+ | |||
+ | -> 진짜 생성은 | ||
+ | |||
+ | @JsonProperty(" | ||
+ | private int yyy; | ||
+ | |||
+ | // 아래 setter 에도 @JsonProperty 가 붙어버림 | ||
+ | @JsonProperty(" | ||
+ | public void setYyy(int yyy) { | ||
+ | this.yyy = yyy; | ||
+ | } | ||
+ | </ |