I am trying to run the spring boot parent project which uses child project, which in turn uses project(ES project) which has elasticsearch dependencies and elasticsearch config bean for transport client.
The child project uses Spring Data ES repositories, which are enabled by a respective annotation in a project.
These are config annotations used in the child:
@Configuration
@ComponentScan("package")
@EntityScan("package3")
@EnableJpaRepositories("package2")
// enables only es repos for current project, ESProject has this annotation for its packages respectively
@EnableElasticsearchRepositories("package1")
The parent project has the only @SPringBootApplication on all packages of ES project and child one.
Parent pom:
<dependencies>
<dependency>
<groupId>org.groupid</groupId>
<artifactId>ChildProject</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
</dependency>
<!-- ... -->
</dependencies>
Child pom:
<dependencies>
<dependency>
<groupId>org.groupid</groupId>
<artifactId>ESProject </artifactId>
<version>1.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<!-- exclusions -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
</dependency>
</dependencies>
ESProject Pom:
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.4.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
</dependencies>
The parent project is a module of pom, which uses Spring Boot 2.0.5.RELEASE.
When I run a parent project I am getting this. Clearly there are some dependencies conflicts but I can't quite figure out them.
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception;
nested exception is java.lang.NoSuchMethodError: org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder.setSource(Ljava/lang/String;)Lorg/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestBuilder;
Also, it's worth noting if I use ESProject in other projects I don't get this exception but I don't have Spring Data ES Repos in those projects.