spring 项目开启热部署
2020-12-11 本文已影响0人
RayGor
1.在需要热部署得项目pom中加入依赖
<dependency>
groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2.在pom文件中加入build标签
<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 settings窗口,修改Compiler的配置

这四项要打勾
-
按 ctrl+shift+alt+/
image.png
选第一个,然后找到下列两项打勾


5.重启IDEA