一、配置Idea中自动编译的相关设置
1)参考步骤: File -> Settings -> Default Settings -> Build -> Compiler 然后勾选 Build project automatically 。
2)参考步骤:同时按住 Ctrl + Shift + Alt + / 然后进入Registry ,勾选自动编译并调整延时参数。
- compiler.automake.allow.when.app.running -> 自动编译
- compile.document.save.trigger.delay -> 静态文件的更新间隔
3)参考步骤:顶部菜单- >Edit Configurations->SpringBoot插件->目标项目->勾选热更新
二、为springboot项目添加热部署组件
参考步骤:在POM文件中导入springboot项目需要的热部署组件,maven代码如下:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>