IDEA中SpringBoot项目热部署

一、在pom添加依赖

<!--热部署-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>

 

二、在yml添加

spring:
  devtools:
  restart:
    additional-paths: classpath:src/main/java

 

三、修改idea配置

File-Settings-Compiler-Build Project automatically

IDEA中SpringBoot项目热部署

按住以下快捷键,唤出 Registry

ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running

IDEA中SpringBoot项目热部署