springboot学习笔记之热部署

pom.xml


  org.springframework.boot
  spring-boot-devtools
  1.5.4.RELEASE
  true



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

开启ide自动编译功能

1.通过sttings-->complier-->Make project automatically勾选


springboot学习笔记之热部署_第1张图片
开启自动编译

2.通过shift + Ctrl + Alt + / 打开如下界面

springboot学习笔记之热部署_第2张图片
快捷键

点击Registry打开如下界面勾选中红线上的选项


springboot学习笔记之热部署_第3张图片
image.png

application.yml

spring:
  devtools:
    restart:
      #以下路径下的文件被修改时重启项目
      additional-paths: src/main/java,src/main/resources/templates
      #以下路径下的文件被修改时不重启项目
      exclude: static/**

将模板引擎的缓存关闭(以freemarker为例)

spring:
  freemarker:
    cache: false

此时修改java代码与templates中的ftl文件都会重启项目

你可能感兴趣的:(springboot学习笔记之热部署)