[SpringBoot] devtools using hot deploy

First, the introduction of dependence

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

Second, modify the configuration file

  • application.properties
#热部署生效
spring.devtools.restart.enabled= true
#设置重启的目录
spring.devtools.restart.additional-paths= src/main/java
#classpath目录下的WEB-INF文件夹内容修改不重启
spring.devtools.restart.exclude= WEB-INF/**

Third, turn on automatic compilation of IDEA

  • File --> Settings --> Compiler-Build Project automatically
  • ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running

Here Insert Picture Description

Published 128 original articles · won praise 1172 · Views 280,000 +

Guess you like

Origin blog.csdn.net/qq_43901693/article/details/104344889