SpringBoot之旅IT技术篇

SpringBoot-03-之热部署

2018-07-16  本文已影响8人  e4e52c116681

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

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配置
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
上一篇下一篇

猜你喜欢

热点阅读