1.导入对应的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!--<optional>true</optional>-->
</dependency>
2.修改idea的配置
3.使用Ctrl + Shift + A 输入Registry 进入 查找compiler.automake.allow.when.app.running 进行勾选
4.重新启动项目