-
正常情况下,我们是把仓库地址配置在settings.xml文件中的mirror节点下,这时如果生成了.lastUpdated文件,默认Maven是不会去取最新资源,但是如果我们把仓库资源配置在settings.xml的<profile>节点中,而不是mirror节点,那么即使更新失败,下一次同步也会忽略这些文件
-
<profile>配置如下:
-
针对PC与Maven私服之间网络传输问题
1. 打开本地仓库所在目录, 通过win文件夹的搜索功能,查找 *.lastUpdated ,然后将找到的文件全部删除
2. 重新 Maven Update Project,
1. 若在eclipse中操作时勾选上 Force Update of Snapshots / Releases
2. 若在命令行操作时增加 -U 参数
一般情况下上面方法即可解决问题. 若问题依然存在,请确认下主机与Maven私服之间网络是否畅通.可以通过在浏览器中打开私服地址确认.
若本机与私服之前网络畅通,那这个问题可能是由于私服与中央仓库(或者其他第三方仓库)之间下载依赖时网络故障导致的.
针对私服与中央仓库或第三方仓库之间网络传输问题
1. 使用管理员登陆私服页面(Sonatype Nexus)
2. 在仓库的浏览页面找到下载失败的包, 右键菜单 “Update Index”, 右键菜单 “Expire Cache”
3. 按照PC与私服之间网络问题的解决步骤处理一遍问题描述:在Eclicpes中用SVN下载项目的是出现pom.xml文件错误
- 1
再三的确认maven配置环境是正常的,本地创建仓库指向的路径也是正常的,那这是怎么鬼?
解决步骤:
首先要确定的是编辑环境中maven已经配置,在Eclipse中已经配置成功;并确保一下路径存在:- 1
确认两个地方的配置文件:
1、pom.xml文件中,下面的配置是否正常,特别注意端口和下载地址是否能正常访问。- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
2、pom.xml文件中,plugins是否配置
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
3、在setting.xml配置文件中mirror配置文件是否和pom.xml中的1的代码一致;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
存在*.lastUpdated文件也能更新jar文件的方法
最新推荐文章于 2024-08-22 10:56:42 发布