idea的设置 build project automatically勾选上 按 ctrl+shift+a 搜索registry,并勾选上…app.running 添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> 在application.yml配置文件中设置 重启idea即可