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

1:添加依赖:toly01\pom.xml
        <!--热部署-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
2.配置文件:src\main\resources\application-dev.yml
  spring:
      devtools:
        restart:
          enabled: true
          additional-paths: src/main/java
3.IDE配置
SpringBoot-03-之热部署
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

相关文章:

  • 2021-12-12
  • 2021-07-29
  • 2021-05-17
  • 2022-12-23
  • 2021-08-15
  • 2021-09-25
  • 2021-05-03
猜你喜欢
  • 2021-07-01
  • 2021-09-07
  • 2021-10-27
  • 2022-12-23
相关资源
相似解决方案