我是靠谱客的博主 追寻鲜花,这篇文章主要介绍IDEA实现SpringBoot热部署(自动加载, 无需每次重启项目)1. 前言2. 进行配置,现在分享给大家,希望可以做个参考。

SpringBoot实现热部署

1. 前言

SpringBoot热部署的方式有三种,分别是使用Spring Loaded本地加载启动,使用SpringLoaded配置pom.xml文件和使用spring-boot-devtools。这里主要介绍使用spring-boot-devtools

2. 进行配置

2.1 Maven搜索依赖

Step1: 百度搜索Maven,点击Maven Repository
在这里插入图片描述
Step2: 搜索spring-boot-devtools,选择版本
在这里插入图片描述
在这里插入图片描述

Step3: 复制依赖
在这里插入图片描述

2.2 在pom.xml中导入依赖

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <version>2.5.2</version>
</dependency>

2.3 IDEA配置

File -> Settings -> Build, Execution, Deployment -> Compiler, 然后勾选Build project automatically
在这里插入图片描述

同时按下Ctrl + shift + Alt + / , 选择Registry, 勾上 compiler.automake.allow.when app.running
在这里插入图片描述
在这里插入图片描述

到此就完成了配置,重启项目即可

最后

以上就是追寻鲜花最近收集整理的关于IDEA实现SpringBoot热部署(自动加载, 无需每次重启项目)1. 前言2. 进行配置的全部内容,更多相关IDEA实现SpringBoot热部署(自动加载,内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(157)

评论列表共有 0 条评论

立即
投稿
返回
顶部