1、IDEA 编写 Spring Boot 项目时,修改了Java文件,浏览器无法实时访问修改后的内容时,此时可以设置热部署插件。
2、在 pom.xml 文件中添加热部署依赖,<plugins> 中设置插件 fork 为 true
<dependencies>
<!--添加热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<!--true 表示依赖不传递-->
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.spri