1,pom添加lombok
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<!-- <scope>provided</scope> -->
</dependency>
2,eclipse安装lombok
找到lombok在本地仓库的位置,双击jar进行安装
QQ截图20190131143519.png QQ截图20190131143541.png
3,具体使用
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LombokDemo {
String name;
Integer age;
}
QQ截图20190131144045.png
网友评论