maven的pom.xml第一行报错以及ArtifactTransferException: Could not transfer artifact.....和 CoreException...的问题...

之前还好好的,今天打开后,就报了很多错误,而且都类似,如下:

1)ArtifactDescriptorException: Failed to read artifact descriptor for log4j:log4j:jar:1.2.17: ArtifactResolutionException: Failure to transfer log4j:log4j:pom:1.2.17 from http://repo1.maven.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 log4j:log4j:pom:1.2.17 from/to central (http://repo1.maven.org/maven2): The operation was cancelled.   pom.xml /face   line 1  Maven Dependency Problem
(2)ArtifactTransferException: Could not transfer artifact com.baidu.aip:java-sdk:jar:4.5.0 from/to central (http://repo1.maven.org/maven2): Write error pom.xml /face   line 22 Maven Dependency Problem
(3)ArtifactTransferException: Could not transfer artifact org.json:json:jar:20160810 from/to central (http://repo1.maven.org/maven2): invalid version format: 1 pom.xml /face   line 1  Maven Dependency Problem


查了一下,发现,原来由于网络等原因,相应的jar包没有抓下来,生成了很多 *.lastUpdated 为后缀的文件,以于是根据报错提示,来到本地仓库中,找到报错的文件,点进去后发现真的没有jar包,只有 *lastUpdated 为后缀的文件,删了之后,果然错误减少了不少,但却变成了第一行报错:

ArtifactTransferException: Could not transfer artifact org.json:json:jar:20160810 from/to central (http://repo1.maven.org/maven2): invalid version format: 1    pom.xml /face   line 1  Maven Dependency Problem



这是由于其他地方也有 *lastUpdated 为后缀的文件,一个一个删不科学,只需在cmd下,进入到本地仓库的目录中,执行此命令,复制粘贴即可:for /r %i in (*.lastUpdated) do del %i
它会自动删除一切 *lastUpdated 为后缀的文件

然后,更新maven项目,如图,我在myeclipse更新我的maven项目后,错误全部消除

这里写图片描述

最新发现:下面这个异常也是上述原因造成,删除 *lastUpdated 的文件后,更新项目,如上图所示,如果有报错没有更新配置,则再更新项目配置,就在update dependencies下面。

 CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile:

转载于:https://www.cnblogs.com/fsn-nervergiveup/p/9748002.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值