SpringBoot项目热部署Dev-tool和常见问题

一.什么是热部署?

应用正在运行的时候升级功能, 不需要重新启动应用,对于Java应用程序来说, 热部署就是在运行时更新Java类⽂件
好处:不需要重新手工启动应用,提高本地开发效率
 
二.常见实现热部署的方式
Jrebel
Spring Loaded
spring-boot-devtools
 
三.在pom.xml中添加相应的依赖
 <dependency> 
 <groupId>org.springframework.boot</groupId> 
 <artifactId>spring-boot-devtools</artifactId> 
 <optional>true</optional> 
 </dependency>
 
 
 <build>
 <plugins>
 <plugin>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-maven-plugin</artifactId>
 <configuration>
 <fork>true</fork><!--必须添加这个配置-->
 </configuration>
 </plugin>
 </plugins>
 </build>

四.idea配置

 

使用快捷键打开,选择Registry
      
      注意默认快捷键:
         window快捷键 Shift+Ctrl+Alt+/
         mac快捷键 Shift+Command+Alt+/

 

 选择compiler.automake.allow.when.app.running ,重启idea就⾏!!!

posted @ 2021-06-30 15:09  Allen-LuoYi  阅读(140)  评论(0)    收藏  举报