在IDEA上开启Spring boot 热部署

工具:IDEA

1.首先在pom.xml中添加热部署依赖 ;   

<!-- 热部署 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    <scope>true</scope>
</dependency>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <!-- 没有该配置,devtools 不生效 -->
                <fork>true</fork>
            </configuration>
        </plugin>
    </plugins>
</build>

2.在IDEA中File->Setting->Build,…->Compiler  将右侧project automatically勾上;

3.在IDEA中ctrl+shift+a 快捷键搜索Registry,选择搜索出来的第一个;

在IDEA上开启Spring boot 热部署

4.进入其中勾选compiler.automake.allow.when.app.running;

在IDEA上开启Spring boot 热部署

4.重启项目,即可开启热部署!!!!!