SpringBoot如何开启开发者模式

1.引入依赖

<!-- https://mvnrepository.com/artifact/org.springframework/springloaded -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>springloaded</artifactId>
    <version>1.2.8.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <version>2.1.3.RELEASE</version>
</dependency>

2.SpringBoot配置

spring:
    thymeleaf: 
      cache: true        
    devtools: 
      restart: 
        enabled: true

设置之后,在修改代码后就不需要再重启项目,为我们节约大量的开发时间

猜你喜欢

转载自blog.csdn.net/aawmx123/article/details/87687506