前提说明
maven版本:3.2.2 eclipse已经正确引入自己安装的maven,且设置好仓库位置 出现错误引入maven工程时,pom.xml出现错误如: 
出错原因一般都是导入别人的工程,因为自己的maven环境、仓库配置信息、下载的jar包来源、甚至时IDE环境不一致导致 解决思路
1.检查maven本地仓库中是否存在改包 (1)若存在:删掉_maven.repositories和_remote.repositories文件(或用文本编辑器打开,将“>main=”改为“>=”,即删除main,当然main也可能是其他值),删除xxxx.lastUpdate相关文件,然后update project 或 update dependency (2)不存在看第2条
2.settings.xml文件是否配置了mirror,即maven下载jar的仓库;是否联网;若都没问题看第3条 3.去settings.xml文件配置的mirror仓库地址查看对应的jar是否存在这个仓库。若找不到,那就换mirror吧,推荐国内网速较快的镜像地址: <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf>
放到<mirrors>标签中即可 或者其它mirror地址如:开源中国的等等 4.直接去maven中央仓库手动对应版本的jar,放到本地仓库对应位置,删除文件夹内不相关文件,重新项目右键-->maven -->update 依赖或者update project 注: 所有关于maven配置或jar或依赖的变更最好都重新:项目右键-->maven -->update dependency或者update project自己解决方式
找到了我的仓库对应的jar位置,发现存在改jar,删除对应的jar: 
eclipse中对项目:右键-->maven--->update project 
问题解决! 附加
_maven.repositories简介: _maven.repositories hold the information about the origin of the artefacts. Maven tries to update your jar from the old location (as saved in _maven.repositories) and fails. The presumtion here is that the same aftifact on a different remote repository might be different. 以上为个人尝试过的解决方案,若有其它解决方案,或者出错说明,欢迎留言,不胜感激!
|