idea 热部署
1.添加依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <!-- 这个需要为 true 热部署才有效 --> <scope>runtime</scope> </dependency>
2.添加插件
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <addResources>true</addResources> </configuration> </plugin>
3.设置application.properties
#即时刷新 spring.thymeleaf.cache=true #热部署生效 spring.devtools.restart.enabled=true #监听目录 spring.devtools.restart.additional-paths=src/main/java
4.开启自动编译
- Ctrl+Alt+S打开配置
-
设置自动编译

Ctrl+Shift+Alt+? 选择Registry
我是因为这个原因一直不成功:

找到选项打勾
