红在网上查找了许多方法,先在pom文件查看是否添加了依赖项,在侧边栏maven projects看到已经有了对应的包,然后在reimport,还是无效,最后在file->invaldiate Caches/Restart。解决报红