I have 2 projects, Project A and Project B. both are gradle projects in separate git repositories. Project B uses elasticsearch-rest-api jar and is included in dependencies as follows:
dependencies {
compile "org.elasticsearch.client:rest:5.4.0",
"org.elasticsearch.client:sniffer:5.4.0"
}
Project A uses Project B and Project B is added as a dependency to Project A as follows:
apply plugin: 'java'
apply plugin: 'spring-boot'
dependencies {
compile "com.example:ProjectB:1.0.0"
}
when i refresh the gradle dependencies of Project A, only Project B jar is available in the "Project and External Dependencies". I am not able to see elastic client rest and sniffer jars in Project A dependencies.
because of this, when i start the Project A spring boot application, it is throwing the below error:
ERROR o.s.b.SpringApplication [main] Application startup failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.discover.paymentservices.dnfraud.pads.txnprocessor.PadsTransactionProcessorApplication]; nested exception is java.io.FileNotFoundException: class path resource [org/elasticsearch/client/RestClient$FailureListener.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:182)
As per my understanding, the Project B dependencies will also be available by default in Project A, since Project B is added as a dependency for Project A.
I tried lot of options including compile time only and providedRuntime etc. not able to figure out the issue. can anyone provide inputs on this. thanks much in advance.