一、什么是热部署?
热部署,就是在应用正在运行的时候升级软件,却不需要重新启动应用。
二、什么是SpringBoot热部署?
SpringBoot热部署就是在项目正在运行的时候修改代码, 却不需要重新启动项目。
有了SpringBoot热部署后大大提高了开发效率,因为频繁的重启项目,浪费很多时间, 有了热部署后,不用担心修改代码重启项目了
三、SpringBoot热部署的流程
1.pom文件中导入 spring-boot-devtools 依赖:
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
2.继续在pom.xml中添加插件: < build> < plugins> < plugin> < groupId>org.springframework.boot< /groupId> < artifactId>spring-boot-maven-plugin< /artifactId> < configuration> < fork>true< /fork> < addResources>true< /addResources> < /configuration> < /plugin> < /plugins> < /build>
3.设置application.properties
#配置项目热部署
spring.devtools.restart.enabled=true