I would like to work with Aerospike and use Spring Data. I found useful library for my goals here.
However, but adding it to dependencies, this code from sample still could not find dependencies.
@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");
}
}
Even less information could be find in the google. I’ve already tried to add another repos, like:
<repositories>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
Also, you could find example of project here. And guess what? That also won’t be built.
I’ve installed latest Maven, updated repositories, still no result. Maybe I am missing some core dependencies?
EDIT:
I’ve added just like any other dependency. Firstly, It wasn’t found at all, but after updating Maven that looked OK. However, I still couldn’t import needed sources.
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-aerospike</artifactId>
<version>1.5.0.RELEASE</version>
</dependency>
Advertisement
Answer
That’s pretty strange, but:
- It is not in the central: http://search.maven.org/#search%7Cga%7C1%7Cspring-data-aerospike
- It is not in spring’s libs-release: https://repo.spring.io/libs-release/org/springframework/data/
- There IS a snapshot in libs-snapshot: https://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-aerospike/
- Here http://www.aerospike.jp/docs/connectors/spring/tutorial_1.html the tutorial depends on
spring-boot-starter-data-aerospikewhich has version 0.0.1-SNAPSHOT, andspring-boot-starter-data-aerospikeis not in the plugins-release repository: https://repo.spring.io/plugins-release/org/springframework/boot/ - In their master
pom.xmlhttps://github.com/spring-projects/spring-data-aerospike/blob/master/pom.xml the version is1.0.1.BUILD-SNAPSHOTwhich is not1.5.0.RELEASEand which preceeds it - There are no tags and no releases in their github repository.
So it looks like no public release was ever made, and their recommendation to ‘Add the Maven dependency’ (the one that you added, with version 1.5.0.RELEASE) will just not work.
To use this library in your project, you could make a checkout via git, build the project (mvn install), then use it from your local repository. Sources could be attached to your IDE manually. To build on other machines later, you could distribute the jar you built and use mvn deploy:deploy-file to install it to their local repositories.