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 勾选

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

 

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

原文地址:https://www.cnblogs.com/hankuikui/p/10137561.html