idea中使用@Autowired引入报红

使用IDEA工具时使用@Resource和@Autowired自动注解bean时会显示红色,但是项目能运行
解决方法:
File – Settings – Inspections。在Spring Core – Autowring for Bean Class 中将Severity的级别由之前的error改成warning。
在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44162368/article/details/90813548