springboot idea 配置热加载

时间:2023-03-09 05:55:16
springboot idea 配置热加载

在idea 配置springboot的热加载,只需要三步:

第一步.引用jar包

        <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>runtime</scope><!--只在运行时起作用 打包时不打进去-->
</dependency>

scope最好加上,是一个好习惯。

第二步:Setting Build Project Automatically 勾选

springboot idea 配置热加载

第三步: 同时按住ctrl+alt+shift+/ 选择registry

springboot idea 配置热加载

springboot idea 配置热加载

设置完成后,启动项目,修改代码,保存,即可看到效果,但是需要等待近4秒中才能重启......