原文链接:https://blog.wanvale.com/archives/96/
新建project-Spring Initializr,添加controller
修改pom.xml
1.修改devtools依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
2.修改plugin
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
3.修改IDEA的设置:
File-Settings-Build,Execution,Deplyment-Compiler
启用Build project automatically
保存后按下Shift+Ctrl+Alt+/
选择Registry
勾选compiler.automake.allow.when.app.running
修改完成,运行程序,修改内容进行测试。