IDEA结合SpringBoot开发中,Autowired报红问题以及解决

IDEA结合SpringBoot开发中,Autowired报红问题以及解决

IDEA结合SpringBoot开发中,Autowired报红问题以及解决
首先AutoWrite注解是在org.springframework.beans.factory.annotation包下的,猜测是没有导入包导致的。
前往https://mvnrepository.com/进行依赖包寻找。
找了半天,发现不能直接搜索factory.annotation
IDEA结合SpringBoot开发中,Autowired报红问题以及解决
搜索org.springframework.beans.成功找到
IDEA结合SpringBoot开发中,Autowired报红问题以及解决
但是版本号不知道用哪个,先懵一个新点的吧
IDEA结合SpringBoot开发中,Autowired报红问题以及解决
导入了,刷新MAVEN依赖包还是找不到,继续尝试解决
IDEA结合SpringBoot开发中,Autowired报红问题以及解决
点击数字出现了提示,那就试试3.1.2吧。
结果确实没报红了
IDEA结合SpringBoot开发中,Autowired报红问题以及解决
但是使用时还是报红,重新刷新MAVEN
IDEA结合SpringBoot开发中,Autowired报红问题以及解决

然后我发现了,原来是我拼错单词了…

是Autowired,而不是AutoWrite那么不导包,可不可以直接用呢?
删除后发现,可以用…
看来多此一举了,猜测是直接SpringBoot给我们自动整合了,ok,继续学习!