gpt4 book ai didi

java - couchbase java 客户端 1.2.* 因 maven 依赖而失败

转载 作者:行者123 更新时间:2023-11-29 07:05:18 30 4
gpt4 key购买 nike

我正在尝试根据 this tutorial 创建一个基本的 java-couchbase hello world 应用程序.

将以下依赖项添加到我的 pom.xml 中:

<dependencies>
<dependency>
<groupId>couchbase</groupId>
<artifactId>couchbase-client</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

但随后我在 pom.xml 中收到此错误:

ArtifactDescriptorException: Failed to read artifact descriptor for
couchbase:couchbase-client:jar:1.2.1: ArtifactResolutionException:
Failure to transfer couchbase:couchbase-client:pom:1.2.1 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 couchbase:couchbase-client:pom:1.2.1 from/to
central (http://repo.maven.apache.org/maven2): null to
http://repo.maven.apache.org/maven2/couchbase/couchbase-client/1.2.1/couchbase-client-1.2.1.pom

我可以看到 jar 存在 in maven central distribution ,我不明白为什么会出现此错误以及如何克服它。

最佳答案

关于错误的异常非常简单:

Failure to transfer couchbase:couchbase-client:pom:1.2.1 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.

为了FORCE更新使用参数-U

 -U,--update-snapshots    Forces a check for updated
releases and snapshots on remote
repositories

来自 mvn --help 选项。

关于java - couchbase java 客户端 1.2.* 因 maven 依赖而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20523018/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com