1、在工程的pom.xml中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2、勾选Build project automatically
<在idea的设置页面,搜索compile,将Build project automatically选项勾选上
3、勾选compiler.automake.allow.when.app.running
同时按shift+ctrl+alt+/(mac电脑按shift+command+alt+/),弹出Maintenance,选择Registry,将compiler.automake.allow.when.app.running勾选上