1.在pom.xml中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.设置下面两项内容
- 文件菜单中设置
文件-->设置(Ctrl+Alt+S)-->构建、执行部署-->Compiler-->勾选"Build project automatically" 点击确定即可
- 快捷键设置
Ctrl+Shift+Alt+/ -->注册-->勾选"compiler.automake.allow.when.app.running" 点击关闭即可