前言
本章记录的是使用 IntelliJ IDEA开发Spring boot项目如何开启热部署
1、使用spring-boot-devtools
1.1、引入依赖
在pom文件中添加 dependency 依赖
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
1.2、进行相关设置
依次点击:file-->setting--->Build,Execution,Deplyment” --> “Compiler”,选中打勾 “Build project automatically” 。如下图:
之后按快捷键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” 。如下图蓝色打钩部分:
之后就可以直接 run 运行了