热部署配置

导入包:

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

如果导入不了,可导入:

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

运行错误再删除:

<version>RELEASE</version>

运行;

yml配置:

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://192.168.100.128:3306/dns_qz?characterEncoding=utf8
    username: root
    password: root
  freemarker:
    cache: false
  thymeleaf:
    cache: true
  devtools:
    remote:
      restart:
        enabled: true
    restart:
        additional-paths: src/main/java

properties:

#开启或者关闭freemarker和thymeleaf的页面缓存
spring.freemarker.cache=false
spring.thymeleaf.cache=true
spring.devtools.restart.enabled=true
#需要开启热部署的文件目录
spring.devtools.restart.additional-paths=src/main/java
#使用了mybatis好像需要设置,应该没有必要。且生产环境需要移除
#restart.include.mapper=/mapper-[\\w-\\.]+jar
#restart.include.pagehelper=/pagehelper-[\\w-\\.]+jar
#静态文件下不需要重启
#spring.devtools.restart.exclude=static/**,public/**
#spring.devtools.restart.exclude=WEB-INF/**
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值