mac删除本地仓库中所有的.lastUpdated

在Mac环境下,使用Eclipse启动Java 12的Maven项目时遇到报错,错误涉及maven-compiler-plugin。问题源于依赖收集失败,具体为ArtifactResolutionException和connect timed out。解决方法是在终端运行命令,或者在Eclipse中修改并保存pom.xml,通过重启Eclipse和重新编译来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mac 下maven工程报错

eclipes是mac版本,java 12 启动后,创建maven工程。报错。错误如下CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.codehaus.plexus:plexus-container-default:jar:1.5.5 -> org.apache.xbean:xbean-reflect:jar:3.4: ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.xbean:xbean-reflect:jar:3.4: ArtifactResolutionException: Failure to transfer org.apache.xbean:xbean-reflect:pom:3.4 from https://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. Original error: Could not transfer artifact org.apache.xbean:xbean-reflect:pom:3.4 from/to central (https://repo.maven.apache.org/maven2): connect timed out

在terminal终端执行下面命令

find /Users/liudawei/.m2/repository -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;

进入eclipse,修改pom.xml.随便删除一行,再将原来的内容拷贝回来,保存。启动重新编译即可。

我的操作是,重启eclispe,然后在做上面的操作

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值