03--SpringBoot之热部署

避免修改内容后必须重启才能再继续玩耍

1:添加依赖:toly01pom.xml
        <!--热部署-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
2.配置文件:srcmain esourcesapplication-dev.yml
  spring:
      devtools:
        restart:
          enabled: true
          additional-paths: src/main/java
3.IDE配置

idea热部署配置

4.其他配置:按照自己需要,一般情况上面的就够了
#热部署生效
spring.devtools.restart.enabled=true
#设置重启的目录,添加指定目录的文件需要restart
spring.devtools.restart.additional-paths=src/main/java
# 为mybatis设置,生产环境可删除
restart.include.mapper=/mapper-[%%w-%%.]+jar
restart.include.pagehelper=/pagehelper-[%%w-%%.]+jar
#排除指定目录的文件不需要restart
#spring.devtools.restart.exclude=static/**,public/**
#classpath目录下的WEB-INF文件夹内容修改不重启
#spring.devtools.restart.exclude=WEB-INF/**
#thymeleaf热部署
spring.thymeleaf.cache=false
原文地址:https://www.cnblogs.com/toly-top/p/9781992.html