springboot之热部署

一、介绍spring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot应用。

二、配置:

pom.xml

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
    </configuration>
</plugin>

idea配置

1.选中 File->Settings->Compiler->Build project automatically

2. 快捷键 ctrl + shift +a 输入registry,勾选 Compiler autoMake allow when app running

猜你喜欢

转载自www.cnblogs.com/nananana/p/9259872.html