热部署Devtools
介绍:简单的来说,在微服务开发中,如果我们的代码改动了以后,我们希望项目能自动重启生效,不需要我们去手动关闭再重启操作
主要分为五个步骤:
1, 在子工程中加入spring-boot-devtools包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2,在父工程中加入spring-boot-maven-plugin包
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
3,设置你的IDEA
4,先快捷键 ctrl+shift+alt+/ ,然后打勾勾
5,重启你的IDAE
最后不要忘记点赞哦。