在idea中实现springboot的热部署
一、idea配置
组合键:“Ctrl+Alt+s”,选择"Compiler",选中"Build Project automatically"。
组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 "compiler.automake.allow.when.app.running" 。
二、pom文件引入依赖spring-boot-devtools
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
注意该依赖的位置为<project>-<dependencies>下
三、pom文件引入依赖springloaded
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</dependency>
注意该依赖的位置为<project>-<build>-<plugins>-<plugin>-<dependencies>下