一、加入devtools依赖

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

  

二、修改页面后,按快捷键ctrl+f9 即可

如果使用了thymeleaf 模板引擎,需要在application.yml增加配置,禁用缓存

spring:
  thymeleaf:
    cache: false

  

如果想修改页面自动更新,在IDEA下可以

File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。

springboot 配置devtools热部署(不用重启服务可以刷新页面)

 

相关文章:

  • 2021-09-22
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2021-11-22
相关资源
相似解决方案