IDEA中配置 springBoot 热部署
- 在pom.xml配置文件中添加功能依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
- Idea 默认并不开启热部署,在Idea中进行配置开启,这里以mac版为例(windows亦可参照)
- 首先,选择右上角的 IntelliJ IDEA ,点击Preferences,如下图所示:

- 在搜索框中搜索 compliler 或者直接找到 Compiler,点击,检查右边的Build Project automatically是否勾选,没勾选则勾选上,然后确定

- 快捷键调出下方页面,MAC 快捷键:Shift+option+command+/,选择Registry
Windows 快捷键:Shift+Ctrl+Alt+/,选择Registry

- 检查第一项 compiler.automake.allow.when.app.running 是否勾选,要勾选上。
此时,热部署配置完成,重启项目即可体验。
