可能也有人遇到过,在eclipse或STS的Maven项目下,我们尝试在pom中加入依赖描述,这时候STS会自动开始从中央仓库下载相应的jar。但是,有时候下载进度因为种种原因卡住,你会手贱把它停止。或者干脆下载失败了。
这时候,问题来了,STS的Maven插件会将此认定了不可更新的依赖组件而再也不去更新它,即使你将它从pom中删除,然后再次加入也是徒劳的,总是提示:
http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
网上的回答也很不清楚,今天来个图文并茂。右键项目,然后如图:
然后勾选“force update snapshots /releases”强制更新.
然后就等着吧,maven会再次尝试,如果还不成功,那就从其他途径找来jar,直接加入本地仓库吧。