1.引入devtools依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2.Settings->Build,Execution,Deployment->Compiler->勾选Build project automatically
3.任意位置按下Ctrl+Shift+Alt+/ 组合键,单击Registry,勾选 compiler.automake.allow.when.app.running,close关闭