spring boot 热部署之idea
首先你要有一个能正常运行的springboot项目,然后才能进行热部署的功能搭建
pom中添加依赖
<!--spring boot 热部署功能--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
pom的mavn打包配置中开启热部署
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build>
配置idea中的设置:ctrl+alt+s 设置如图
ctrl+shift+alt+/ 设置register compiler.automake.allow.when.app.running 勾上 重启项目就可以了
转载于:https://my.oschina.net/wugong/blog/1790456