首页
学习
活动
专区
圈层
工具
发布

SpringBoot-03-之热部署

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

1:添加依赖:toly01\pom.xml
代码语言:javascript
代码运行次数:0
复制
        <!--热部署-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
2.配置文件:src\main\resources\application-dev.yml
代码语言:javascript
代码运行次数:0
复制
  spring:
      devtools:
        restart:
          enabled: true
          additional-paths: src/main/java
3.IDE配置

idea热部署配置

4.其他配置:按照自己需要,一般情况上面的就够了
代码语言:javascript
代码运行次数:0
复制
#热部署生效
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
下一篇
举报
领券