0
点赞
收藏
分享

微信扫一扫

热部署功能(不重启编译)

无聊到学习 2022-02-18 阅读 34

开发每次修改程序都需要重启SpringBoot服务,这种启动方式叫做冷启动,冷启动速度很慢显然非常麻烦,SpringBoot提供了热部署功能,利用这个功能,可以不启动SpringBoot服务就可以使改变生效,大大提升效率。

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

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork>
            </configuration>
        </plugin>
    </plugins>
</build>
  • build一般默认已经加上了,添加configuration中的内容就可以。
  1. 开启自动编译

在这里插入图片描述

  1. 然后利用热键打开IDEA秘密设置参数:Shift + ctrl + Alt + /

在这里插入图片描述

在这里插入图片描述

举报

相关推荐

0 条评论