SpringBoot热部署

 前言:本人为学习阶段,哪里有不对的地方,或者哪里可以做得更好的地方,希望各位前辈大佬指正和提出建议,感谢!


1、SpringBoot热部署

(1)导入依赖(自己找一个版本)

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    <scope>true</scope>
</dependency>

(2)资源文件配置

spring:  
  #热部署配置
  devtools:
    restart:
      enabled: true  #设置开启热部署
      additional-paths: src/main/java #重启目录
      exclude: WEB-INF/**
  freemarker:
    cache: false    #页面不加载缓存,修改即时生效

(3)配置idea   File->Settings->Compiler->Build Project automatically

 

 

 

 (4) ctrl + shift + alt + / , 选择Registry,勾上 Compiler autoMake allow when app running

 

 

 

 


2020-10-14

 

ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running

posted @ 2020-10-14 20:50  头发茂盛  阅读(76)  评论(0)    收藏  举报