Cannot use custom autoconfiguration with spring-data-elasticsearch
The problem is that spring-boot
1.3.2.RELEASE is not yet working with spring-data-elasticsearch
2.0.0-RELEASE.
spring-boot
1.3.2 will include spring-boot-starter-data-elasticsearch
1.3.2-RELEASE which still depends on elasticsearch 1.5.2
ES 2.0 will be supported as of spring-boot
1.4.0-RELEASE which has not yet been released (but you could try with 1.4.0.BUILD-SNAPSHOT to see if that helps)
Since you also explicitly include spring-data-elasticsearch
2.0.0-RELEASE you get the 2.0 version of elasticsearch included but you should remove that dependency as it is managed by spring-boot-starters
itself
Please follow below steps
- Remove following dependency from your POM
<groupId>org.springframework.data</groupId> <artifactId>spring-data-elasticsearch</artifactId> <version>2.0.0.RELEASE</version>
- Add following dependency spring-boot dependency
<groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-elasticsearch</artifactId><version>1.3.5.RELEASE</version>
You will need to wait for spring boot 1.4.x to use elasticsearch v2.2.2
Spring-boot branch 1.3.x is still using elasticsearch v1.5.2.
try alter your pom and change:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.BUILD-SNAPSHOT</version> <relativePath/> <!-- lookup parent from repository --></parent>
and add:
<repositories> <repository> <id>spring-snapshots</id> <url>http://repo.spring.io/snapshot</url> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>spring-milestones</id> <url>http://repo.spring.io/milestone</url> </repository></repositories><pluginRepositories> <pluginRepository> <id>spring-snapshots</id> <url>http://repo.spring.io/snapshot</url> </pluginRepository> <pluginRepository> <id>spring-milestones</id> <url>http://repo.spring.io/milestone</url> </pluginRepository></pluginRepositories>