在pom文件中添加一下依赖,重新打包运行就ok
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin>