首页 > 编程语言 > 详细

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

时间:2021-04-15 09:03:14      阅读:21      评论:0      收藏:0      [点我收藏+]

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

插件方式(有空再说)

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

原文:https://www.cnblogs.com/sgw1018/p/14660467.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!