IDEA SpringBoot热部署

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qugengting/article/details/86219174

两步走:

一、IDEA设置:

1、CTRL + SHIFT + A --> 查找make project automatically --> 选中 
2、CTRL + SHIFT + ALT + /  --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running 

二、pom.xml配置:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

三(application.properties文件,可选择)、

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

猜你喜欢

转载自blog.csdn.net/qugengting/article/details/86219174