springboot开启热部署之Idea&Gradle

一、引入starter

//热部署
compile("org.springframework.boot:spring-boot-devtools")
  • 1
  • 2

二、开启自动编译

第一步

windows:ctrl + alt + shift + /

mac: command + alt + shift + /
  • 1
  • 2
  • 3

弹出以下界面

这里写图片描述

第二步

点击Registry,勾选compiler.automake.allow.when.app.running

这里写图片描述

第三步

勾选 Make/Build project automatically

这里写图片描述

重新运行项目,随意改一个java类,看看项目是不是重启了^_^

猜你喜欢

转载自blog.csdn.net/jonwu0102/article/details/81064776