使用Eclipse集成了Maven插件开发,使用的是Maven的默认配置.经常出现在pom.xml文件中添加了依赖之后jar包下载卡死的过程. 现在提出了两种解决方法.
1 使用本地maven仓库, 上maven仓库下载对应的jar文件,把jar文件放到对应的jar包位置. 把dependency删除. 保存,再添加回来. 这样pom.xml会重新刷新. 然后就省去了下载jar文件的过程了.
2 更换更快的maven公共仓库地址. 试了几个,在网上发现了一个阿里云的maven仓库地址,试用了一下确实不错.现在共享出来.
上述两步都要对maven的usersetting.xml文件进行调整才行.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--添加本地仓库地址-->
<localRepository>E:/maven/repository</localRepository>
<!--使用阿里云maven仓库-->
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
userSetting文件修改位置:
修改完记得reindex.