Ant编译失败,提示依赖包不存在

【问题描述】
Ant编译一直停滞,等待10多分钟后,提示失败,提示找不到依赖包。

[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]          ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]          :: org.apache.ant#ant;1.8.2: not found
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :::: ERRORS
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]  impossible to acquire lock for org.apache.ant#ant;1.8.2
[ivy:retrieve]
[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

【问题分析】
但是去本地仓库/home/[user]/.ivy2/cache/org.apache.ant/ant/jars/目录下查找依赖包是存在。

Ant编译失败,提示依赖包不存在_第1张图片

在/home/[user]/.ivy2/cache/org.apache.ant/ant/metadatas/目录下发现了ant-1.8.2.jar.ivy.lck文件,应该是这些锁文件影响了ant编译时依赖包的获取。

【问题解决】
删除/home/[user]/.ivy2/cache目录下所有的*.ivy.lck
1、可以先查找这些锁文件是否存在

find /home/[user]/.ivy2/cache -name "*.ivy.lck"

2、然后删除所有锁文件

find /home/[user]/.ivy2/cache -name "*.ivy.lck" | xargs rm

你可能感兴趣的:(Ant编译失败,提示依赖包不存在)