Springboot 热部署(idea版)

1.引入热部署依赖

使用devtools启动热部署,添加devtools库,在配置文件中把Spring devtools.restart.enabled设置为true:
Springboot 热部署(idea版)

2.勾选idea自动编译

settings—>Compiler—>勾选Build project automatically
Springboot 热部署(idea版)
Springboot 热部署(idea版)

3.允许应用在运行时启动自动编译

  1. 快捷键Ctrl+shift+a
  2. 输入Registry
  3. 勾选compiler.automake.allow.when.app.running

Springboot 热部署(idea版)

4.重新启动项目即可