java - 添加依赖项mockito 1.10.19版本时出现ArtifactDescriptorException

标签 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 版本有什么问题。 任何帮助都会有所帮助。谢谢!

最佳答案

听起来之前的下载尝试失败了。正如消息所述,在中央更新间隔已过或强制更新之前,不会重新尝试解析 - 通常更新间隔为 24 小时。

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

仅供引用,相同的 Artifact 版本可以从这里下载良好。

关于java - 添加依赖项mockito 1.10.19版本时出现ArtifactDescriptorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51002827/

相关文章:

java - 单击 RecyclerView 项目时调用 fragment 并将它们都显示在同一个 Activity 中

java - spring boot maven编译包不存在

eclipse - 将 Tycho “pomless” 项目导入 Eclipse

java - 无法找到页面上不同 block 上存在的相同字段的元素,因为 xpath 和所有其他实体都相同

java - 带有 Mono.empty() 参数的响应式(Reactive) Java Mono.zip

java - 贾克斯-RS : Getting error message from REST call?

java - 本地非 maven jar 正在 maven 服务器上搜索。为什么?

java - Glide 3.8.0 在 RecyclerView 中有重复的图像

maven - 类似于 intellij 的 nbactions.xml 的文件

java - 从 Maven 自动下载并运行独立的 Java 应用程序