Spring Bootz之热部署

在项目的pom.xml文件添加如下两段

<dependency>  

            <groupId>org.springframework.boot</groupId>  

            <artifactId>spring-boot-devtools</artifactId>

            <version>1.5.7.RELEASE</version>

            <optional>true</optional>  

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

Intellij IEDA开发工具,还需要到设置里将project automatically勾选上;File->Setting->Build,…->Compiler  将右侧project automatically勾上

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

此时重新启动项目即可实现热部署,改动任意代码会立即生效,不用再每次重新启动项目

原文地址:https://www.cnblogs.com/loaderman/p/10234459.html