代码之家  ›  专栏  ›  技术社区  ›  ChrisDekker

Spring Boot、Elasticsearch 6.2.4、Gradle依赖性问题

  •  1
  • ChrisDekker  · 技术社区  · 7 年前

    在我的中创建以下依赖项时 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'
    }
    

    ./gradlew dependencies

    +--- org.elasticsearch.client:elasticsearch-rest-high-level-client:6.2.4
    |    +--- org.elasticsearch:elasticsearch:6.2.4 -> 5.6.11
    

    io.spring.dependency-management

    请注意,我没有使用 spring-data 目前,我也没有计划在短期内转移到这一点。我当前的应用程序管理ES客户机和所有交互本身,没有任何Spring抽象层。

    1 回复  |  直到 7 年前
        1
  •  11
  •   Vlad Mamaev    7 年前
    ext {
        set('elasticsearch.version', '6.2.4')
    }
    

    Blogpost about overriding versions

        2
  •  0
  •   sonus21    6 年前

    ext['elasticsearch.version'] = '6.2.4'
    

    Reference Doc section 3.1 Customizing managed versions

    这些版本在以下位置提供 https://github.com/spring-projects/spring-boot/blob/v2.1.6.RELEASE/spring-boot-project/spring-boot-dependencies/pom.xml

    不同的版本在pom文件中会有一组不同的版本。

        3
  •  0
  •   Kumar V    5 年前

    compile ("org.elasticsearch.client:elasticsearch-rest-high-level-client:${property('elasticsearch.version')}")