idea编辑器下的spring boot 热部署

①pom文件中添加  devtools:

<!-- 热部署模块 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>

②pom文件中添加  plugin:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <fork>true</fork>
    </configuration>
</plugin>

③菜单栏里找到setting

④按快捷键 Shift+Ctrl+Alt+/ ,点击 Registry 

⑤在application.properties/application.yml中

spring:
  thymeleaf:
    cache: false
  freemarker:
    cache: false
  groovy:
    template:
      cache: false
  velocity:
    cache: false

⑥在chrome浏览器中  F12  >>  禁用缓存

⑦运行项目即可。

猜你喜欢

转载自blog.csdn.net/july_young/article/details/81533527
今日推荐