Spring Boot,Elasticsearch 6.2.4,Gradle依赖问题

Chr*_*ker 1 spring elasticsearch spring-boot

我正在将旧版应用程序转换为Spring Boot。该应用程序当前使用Elasticsearch 6.2.4

在我的build.gradle文件中创建以下依赖项时,它包含错误版本的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'
}
Run Code Online (Sandbox Code Playgroud)

来自的输出 ./gradlew dependencies

+--- org.elasticsearch.client:elasticsearch-rest-high-level-client:6.2.4
|    +--- org.elasticsearch:elasticsearch:6.2.4 -> 5.6.11
Run Code Online (Sandbox Code Playgroud)

我假设这是由于io.spring.dependency-management插件而发生的一些魔术。

在将此旧版应用程序转换为Spring Boot时,如何覆盖此行为并仍然使用我的显式配置版本?

请注意,我目前不在使用spring-data,也没有计划很快将其转移到该位置。我当前的应用程序无需任何Spring抽象层即可管理ES客户端及其所有交互。