Spring Boot在idea中热部署配置
先配置idea默认自动编译,这样以后创建和导入的项目就是自动开启编译的了
步骤:File --->Other Settings --->Default Settings
勾选Build project automatically,然后apply
然后按住ctrl + alt +shift + / 键,选择Registry ,勾选compiler.automake.allow.when.app.running
在项目的pom文件中添加spring boot热部署依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
配置pulgin
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--添加springboot热部署配置--> <fork>true</fork> </configuration>
</plugin>
然后就可以实现热部署了