解决方案:
在eclipse中打开菜单 window-> show view –> other –> Maven -> maven repositories
打开之后,选择local repositories –> local repository ,右击,选择Build index.

新完索引之后,在通过右键单击pom.xml文件选择maven –> add dependency 或者是打开pom.xml文件,选择dependencies –>add 时,就可以搜索到本地仓库的jar包了。
补充知识:spring中出现的错误:The import org.springframework cannot be resolved
用myeclipse+maven环境,做spring+mybatis测试的时候遇到的。
错误:The import org.springframework cannot be resolved

关于这个错误,从字面意思上看属于有的包没有导入。于是在网上查找需要导入哪个包,说什么的都有,但是找到了个靠谱的 参考,下面是感觉重要的摘了下来:

注意:SpringJUnit4ClassRunner这个类是位于spring-test-4.1.6.RELEASE.jar这个包中的
解决办法是在pom.xml文件中添加依赖,代码如下:

下一篇:Docker如何部署web项目