学习笔记(03):互联网架构系列全套SpringBoot2.x初级入门到实战-SpringBoot2.x使用Dev-tool热部署...

立即学习:https://edu.csdn.net/course/play/8072/165409?utm_source=blogtoedu

  • 配置devtools依赖

springboot devtools热加载在Eclipse中不需要做什么配置,只需要将依赖包加入


    org.springframework.boot
    spring-boot-devtools
    true

修改任意代码后,crtl+s保存后就会自动加载并发布。

但是在idea中修改文件后,是自动保存的。所以就需要进行设置:

1.ctrl+shift+s,如图设置:

学习笔记(03):互联网架构系列全套SpringBoot2.x初级入门到实战-SpringBoot2.x使用Dev-tool热部署..._第1张图片

 2.在pom.xml中加入


   
      
         org.springframework.boot
         spring-boot-maven-plugin
               
                   true
               
      
   

3.ctrl+shify+a,输入Registry,勾选compiler.automake.allow.when.app.running

备注:静态资源文件改动时,默认不会热部署。

  • 有选择性的进行重启配置:

在application.propterties中配置

#除了那些文件改动时,不会更新热部署
#spring.devtools.restart.exclude=application.properties
#定义某个文件改动了才会重新启动
spring.devtools.restart.trigger-file=trigger.txt

 

你可能感兴趣的:(研发管理)