Make a note of what you did when using Lombok for Spring
Specify as follows in pom.xml
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
Instead of using @Data, use as much as you need (Addition: Because "@Getter, @Setter, @ToString, @EqualsAndHashCode, @RequiredArgsConstructor" will be given together. There is no problem if you use it after understanding it. )
When using @toString in a mutually related class, it loops infinitely, so add the exclude attribute to avoid it.
Lombok usage memo It was easy to use Lombok with Spring Boot
Mac:macOS Sierra 10.12.5
Eclipse:Eclipse Java EE IDE for Web Developers.
Oxygen Release (4.7.0)
Lombok:1.16.18
Lombok installer did not work well on Mac
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar
What to do if the lombok installer doesn't work on eclipse mars / neon on mac
Provided is specified in scope. The reason is that Lombok parses the source at compile time and generates boilerplate code. The function is realized by passing it to the compiler, and it is no longer necessary after generation. For details, the following was very helpful.
When I tried to Maven build the project, the following error was displayed.
java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags
When I checked it, it looked like a bug and the countermeasures had already been taken, so if I specified 1.16.22, the error was resolved.
It was said that it occurred in JDK10, but it also occurred in 1.8.
Github:lombok
Changed the version of pom.xml from 1.16.18
to 1.18.8
.
Recommended Posts