springboot热部署

mac2025-09-15  3

1. pom.xml 添加热部署依赖和插件

<!--热部署--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <scope>true</scope> </dependency> <!--热部署插件--> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--如果没有这个配置,spring devtools插件不会起作用  --> <fork>true</fork> </configuration> </plugin>

2. idea 设置项目自动生成

3. ctrl + shift + a  快捷键打开 register  找到 程序运行时允许自动编译

4. 重启idea,测试效果。完成热部署!!

最新回复(0)