▌打开设置-Compiler
勾选Build project automatically并保存

▌修改pom.xml文件
在dependency和plugin中添加
<!--添加热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>代码语言:javascript复制 <plugin>
<!--热部署配置-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork:如果没有该项配置,整个devtools不会起作用-->
<fork>true</fork>
</configuration>
</plugin>▌如果使用了thymeleaf模板
需要在配置文件application.properties中设置(没有使用则不需要设置)
spring.thymeleaf.cache=false重启项目,热部署应该是已经生效了。


