IDEA使用技巧/IDEA热部署

  • 在 File -> Settings -> Build, Execution, Deployment -> Compiler 中勾选 Build project automatically,如下图所示

  • 同时按住 Ctrl + Shift + Alt + / 进入Registry,同时勾选以下三项

  • 开启热部署策略,在Edit Configurations中选择运行策略

  • 引入pom依赖
1
2
3
4
5
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
  • 最后需要关闭浏览器缓存,如下图