首先引入了开发工具坐标:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
然后:
-
勾选自动构建项目
-
使用快捷键:ctrl + shift + alt + /
找到compile.automake.allow.when.app.running,打勾。
点击close即可。
自动重构的条件是:焦点离开IDEA工具5s,就会进行重构。