春季数据空刺

que*_*nto 5 java spring-data aerospike

我愿与工作Aerospike和使用Spring Data。我在这里找到了对我的目标有用的库。

但是,但是将其添加到依赖项中,示例中的这段代码仍然找不到依赖项。

@Configuration
@EnableAerospikeRepositories(basePackageClasses = 
ContactRepository.class)
class ApplicationConfig extends AbstractAerospikeConfiguration {
public @Bean(destroyMethod = "close") AerospikeClient aerospikeClient() {

    ClientPolicy policy = new ClientPolicy();
    policy.failIfNotConnected = true;

    return new AerospikeClient(policy, "localhost", 3000);
}

public @Bean AerospikeTemplate aerospikeTemplate() {
    return new AerospikeTemplate(aerospikeClient(), "bar");
}
}
Run Code Online (Sandbox Code Playgroud)

在谷歌中可以找到更少的信息。我已经尝试添加另一个存储库,例如:

    <repositories>
    <repository>
        <id>spring-milestone</id>
        <url>https://repo.spring.io/libs-release</url>
    </repository>
</repositories>
Run Code Online (Sandbox Code Playgroud)

此外,您可以在此处找到项目示例。你猜怎么着?那也不会建。

我已经安装了最新的Maven、更新的存储库,但仍然没有结果。也许我缺少一些核心依赖项?

编辑:

我已经添加了任何其他依赖项。首先,它根本没有找到,但更新后Maven看起来还可以。但是,我仍然无法导入所需的资源。

        <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-aerospike</artifactId>
        <version>1.5.0.RELEASE</version>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

Rom*_*kiy 4

这很奇怪,但是:

  1. 它不在中央:http ://search.maven.org/#search%7Cga%7C1%7Cspring-data-aerospike
  2. 它不在 spring 的 libs-release 中:https://repo.spring.io/libs-release/org/springframework/data/
  3. libs-snapshot 中有一个快照:https://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-aerospike/
  4. 这里http://www.aerospike.jp/docs/connectors/spring/tutorial_1.html该教程取决于spring-boot-starter-data-aerospike哪个版本为0.0.1-SNAPSHOT,并且spring-boot-starter-data-aerospike不在plugins-release存储库中:https://repo.spring .io/plugins-release/org/springframework/boot/
  5. 在他们的master pom.xml https://github.com/spring-projects/spring-data-aerospike/blob/master/pom.xml中,版本是1.0.1.BUILD-SNAPSHOT哪个不是1.5.0.RELEASE,哪个在它之前
  6. 他们的 github 存储库中没有标签,也没有版本。

因此,看起来似乎从未发布过任何公开版本,并且他们对“添加 Maven 依赖项”(您添加的版本,带有 version 1.5.0.RELEASE)的建议将不起作用。

要在项目中使用此库,您可以通过 git 签出,构建项目 ( mvn install),然后从本地存储库使用它。源可以手动附加到您的 IDE。要稍后在其他计算机上构建,您可以分发您构建的 jar 并用于mvn deploy:deploy-file将其安装到本地存储库。