来源:https://www.cnblogs.com/c2g5201314/p/13063510.html

  1. 导入依赖包
 <!-- 热修改前端-->
 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
  1. 操作步骤 : File >> Settings >>Build, Execution, Deployment >> Compiler ,

勾上“”Build project automatically"这个选框,保存

在这里插入图片描述

  1. 按住ctrl + alt+ shift + /, 选择第一个Registry
    在这里插入图片描述

  2. 在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
6. 部分浏览器需要关闭浏览器的缓存,才能及时刷新前端页面

关闭浏览器的缓存文件功能,我是使用谷歌的chome

那么就把disable cache勾选 ,其他浏览器也需要关闭的,这里就不展示。

关闭浏览器的缓存文件功能,我是使用谷歌的chome

那么就把disable cache勾选 ,其他浏览器也需要关闭的,这里就不展示。

该方式仅能修改热更新前端 ,如 js,jsp,html.css等.

java后端部分无法热更新,需要插件Jrebel才可以

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐