<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
在导入需要的jar之后,设置yml文件。
debug: true
spring:
devtools:
restart:
enabled: true #设置开启热部署
freemarker:
cache: false #页面不加载缓存,修改即时生效
修改idea的配置:
File-Settings-Compiler-Build Project automatically
ctrl + shift + alt + /然后选择Registry,勾上 Compiler.autoMake.allow.when.app.running