Springboot+idea热部署(自动刷新)

spring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot应用。

devtools的方式

  1. 添加依赖
<!--添加热部署-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    <scope>true</scope>
</dependency>

<plugin>
    <!--热部署配置-->
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <!--fork:如果没有该项配置,整个devtools不会起作用-->
        <fork>true</fork>
    </configuration>
</plugin>
  1. 设置IDEA的自动编译
    • File-Settings-Compiler勾选 Build Project automatically
    • 快捷键 ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running

插件方式(有空再说)

上一篇:OpenWhisk搭建手册


下一篇:vue-devtools 开发工具插件 支持vue3 chorme 浏览器插件