pom文件导入(对于配置文件不会生效):
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <version>${spring.boot.version}</version> <scope>runtime</scope> <optional>true</optional> </dependency>启用自动构建:
文件(File)-> 设置(Settings)
构建、执行、部署(Build, Execution, Deployment)-> 编译器(Compiler)
勾选 "构建项目自动(Build project automatically)"
检查运行配置:
点击运行按钮旁边的小三角形,选择 "编辑配置(Edit Configurations...)"
在 "运行的应用程序更新策略(Running Application Update Policies)" 部分
确保 "在'更新'操作时(On 'Update' action)" 设置为 "更新类和资源(Update classes and resources)"
"失焦时(On frame deactivation)" 也可以设置为 "更新类和资源(Update classes and resources)"