idea下载插件 JRebel 如图 下载后重启 idea
pom.xml引用配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>true</scope>
<optional>true</optional>
</dependency>
<build>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</build>
按住 ctrl + shift +alt +/
修改这三个
compiler.automake.trigger.delay
compiler.document.save.trigger.delay
compiler.automake.allow.when.app.running
这个配置可有可无
spring:
# 热部署配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML
encoding: utf-8
servlet:
content-type: text/html
cache: false
重启idea 如下图dibug启动,每次修改代码之后按ctrl+s保存 会自动编译,亲测有效