1.引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.修改pom文件,添加
<configuration> <fork>true</fork> </configuration>
至如下地方
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
3.修改IDEA配置
“File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
4.IDEA中快捷键“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中 “compiler.automake.allow.when.app.running”
5.重启IDEA,运行项目
每次修改Java或html code后,在IDEA上使用快捷键 "Ctrl+Shift+F9"即可实现快速热部署。