ArtifactDescriptorException,同时添加了依赖嘲讽1.0.1.19版本

时间:2018-06-23 16:01:18

标签: java maven

在pom.xml文件中添加以下依赖项时,出现ArtifactDescriptorException

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-all</artifactId>
    <version>1.10.19</version>
    <scope>test</scope>
</dependency>

问题:

Description Resource    Path    Location    Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.mockito:mockito-all:jar:1.10.19: ArtifactResolutionException: Failure to transfer org.mockito:mockito-all:pom:1.10.19 from http://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.mockito:mockito-all:pom:1.10.19 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org  pom.xml /mockito-example    line 1  Maven Dependency Problem

但是,它可以与1.10.18或1.10.17一起正常工作

 <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.10.18</version>
        <scope>test</scope>
    </dependency>

我不明白1.10.19版本的问题是什么。 任何帮助都会有所帮助。谢谢!

1 个答案:

答案 0 :(得分:2)

类似较早的下载尝试的声音失败。如消息所述,resolution will not be reattempted until the update interval of central has elapsed or updates are forced-通常更新间隔为24小时。

如果尚未尝试过,建议使用强制更新选项-mvn -U。 (如果在Eclipse中,则根据列标题判断,请在Force Update / Maven对话框中查找Update project。)

仅供参考,可以从此处下载相同的工件版本。