1、在pom.xml中添加依赖<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.20</version> <scope>provided</scope> </dependency> 2、安装lombok插件3、配置注解处理器