idea版本: 2021.3
pom.xml 导入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
配置idea编辑器
- Build project automatically
File > Settings > Build,Execution,Deployment > Compiler > 选中 Build project automatically
- Allow auto-make to start even if developed application is currently running
File > Settings > Advanced Settings > 选中 Allow auto-make to start even if developed application is currently running
注意(2021 之前的 idea 版本):
2021 之前的 idea 版本,第【2】项配置方式如下:
组合键 【Ctrl + Shift + Alt + /】 > Registry
选中 compiler.automake.allow.when.app.running
选中 compile.document.save.trigger.delay