Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again. Early access to future java features such as val, and much more.
1 | |
javac
1 | |
Eclipse
install lombok plug-in
1 | |
或者
first copy lombok-1.18.6.jar to Eclipse installation directory, then edit the eclipse.init file and add the following entry: -javaagent:lombok.jar或-vmargs -javaagent:lombok.jar
IntelliJ IDEA
install lombok plug-in
Required IntelliJ Configuration
In your project Settings: Click Build, Execution, Deployment -> Compiler, Annotation Processors. Click Enable Annotation Processing
Afterwards you might need to do a complete rebuild of your project via Build -> Rebuild Project.
注解
@Data
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Slf4j
1 | |