pom.xml引入了
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> 依赖,
但是相关的@RestController系列注解都无法使用,首先肯定不存在版本冲突问题,因为不论<parent>中springboot是多老版本,其同版本的web启动包都有这系列注解。然后想着IDEA抽风,与是关闭项目,重启IDEA,从源码位置导入项目,依旧老问题。接着换了一个新版本idea导入,正常。可以确定是刚使用的老版本idea哪里配置出了问题,百度找到了File -> Invalidate Caches/Restart清除idea缓存并重启,问题解决!(历时大半个下午)