Springboot-实现热部署

热部署:在应用正在运行的时候进行部署,不需要手动重新启动应用。

1.在pom.xml中添加dependence和plugins

1 <!--热部署-->
2 <dependency>
3     <groupId>org.springframework.boot</groupId>
4     <artifactId>spring-boot-devtools</artifactId>
5     <optional>true</optional>
6 </dependency>
1 <plugin>                                 
2     <groupId>org.springframework.boot</groupId>
3     <artifactId>spring-boot-maven-plugin</artifactId>
4     <configuration>
5         <fork>true</fork><!--注意要修改这里-->
6     </configuration>
7 </plugin>    

2.在IDEA中设置settings开启自动编译

3.在IDEA中修改Registry

使用 ctrl+shift+a 快捷键搜索 Registry,点击进入,找到compiler.automake.allow.when.app.running,勾上开启此功能即可(勾选过一次好像之后就不显示了...)。

4.重启IDEA 

原文地址:https://www.cnblogs.com/leirocks/p/9075204.html