I am converting a legacy application to Spring Boot. This application currently uses Elasticsearch 6.2.4
When creating the following dependencies in my build.gradle
file, it includes the wrong version of Elasticsearch, 5.6.11:
dependencies {
// Spring Boot Starters
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.springframework.boot:spring-boot-starter-mail'
// Elasticsearch
compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.2.4'
}
Output from ./gradlew dependencies
+--- org.elasticsearch.client:elasticsearch-rest-high-level-client:6.2.4
| +--- org.elasticsearch:elasticsearch:6.2.4 -> 5.6.11
I am assuming this is some magic happening due to the io.spring.dependency-management
plugin.
How can I override this behavior and still use my explicit configured version while converting this legacy application to Spring Boot?
Note that I am not using spring-data
at the moment, nor do I have plans to move to that anytime soon. My current application manages the ES client and all interactions itself without any Spring abstraction layer.
ext {
set('elasticsearch.version', '6.2.4')
}
Blogpost about overriding versions
While searching answer for same I came across following soln:
ext['elasticsearch.version'] = '6.2.4'
Reference Doc section 3.1 Customizing managed versions
These versions are picked BOM file available at https://github.com/spring-projects/spring-boot/blob/v2.1.6.RELEASE/spring-boot-project/spring-boot-dependencies/pom.xml
The different release would have a different set of versions in the pom file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With