如何将spring数据opensearch添加到java maven项目中

hmae6n7t  于 2023-02-18  发布在  Java
关注(0)|答案(1)|浏览(343)

我想将此库https://github.com/opensearch-project/spring-data-opensearch添加到我的项目中
我添加了依赖项:

<dependency>
    <groupId>org.opensearch.client</groupId>
    <artifactId>spring-data-opensearch</artifactId>
    <version>3.0.0-SNAPSHOT</version>
</dependency>

并添加回购协议:

<repositories>
    <repository>
        <id>opensearch-libs-snapshot</id>
        <name>AWS Snapshot Repository</name>
        <url>https://aws.oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
</repositories>

我看到这个错误:

Failure to find org.opensearch.client:spring-data-opensearch:jar:3.0.0-SNAPSHOT in https://aws.oss.sonatype.org/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of opensearch-libs-snapshot has elapsed or updates are forced
ef1yzkbh

ef1yzkbh1#

spring-data-opensearch 1.0.0是released
摘自自述文件
目前,SpringDataOpenSearch提供了使用RestHighLevelCLient连接到OpenSearch集群的可能性。

<dependency>
  <groupId>org.opensearch.client</groupId>
  <artifactId>spring-data-opensearch</artifactId>
  <version>1.0.0</version>
</dependency>

要使用Sping Boot 3.x自动配置支持:

<dependency>
  <groupId>org.opensearch.client</groupId>
  <artifactId>spring-data-opensearch-starter</artifactId>
  <version>1.0.0</version>
</dependency>

使用Sping Boot 3.x自动配置支持进行测试:

<dependency>
  <groupId>org.opensearch.client</groupId>
  <artifactId>spring-data-opensearch-test-autoconfigure</artifactId>
  <version>1.0.0</version>
  <scope>test</scope>
</dependency>

相关问题