springboot热启动

在pom.xml中的dependencies中添加:

1
2
3
4
5
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>

改build:

1
2
3
4
5
6
7
8
9
10
11
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>

之后reimport,成功之后进行如下设置:

打开idea ,File->Settings-> Build-Execution-Deployment -> Compiler勾选 Build Project Automatically.
image

之后按 Shift+Ctrl+A 将看到弹窗 Enter Action or option name,输入”registry”,双击第一项”Registry…” ,会弹出另一个窗口,寻找compiler.automake.allow.when.app.running并且勾选:

image

之后重启项目,在修改resources文件和java文件时会自动加载或者重启。

-------------本文结束 感谢您的阅读-------------