问题描述
如何声明spring-data-elasticsearch 4.1.0-RC1版本
https://github.com/spring-projects/spring-data-elasticsearch/releases
我使用了以下存储库,但似乎不起作用
implementation group: 'org.springframework.boot',name: 'spring-boot-starter-data-elasticsearch',version: '4.1.0-RC1'
maven { url "http://repo.spring.io/libs-release" }
maven { url "http://repo.spring.io/libs-milestone" }
maven { url "http://repo.spring.io/libs-snapshot" }
* What went wrong:
Execution Failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
required by:
project :
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
> Could not get resource 'http://repo.spring.io/libs-release/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'.
> Could not GET 'http://repo.spring.io/libs-release/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
> Could not get resource 'http://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'.
> Could not GET 'http://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.springframework.boot:spring-boot-starter-data-elasticsearch:4.1.0-RC1.
> Could not get resource 'http://repo.spring.io/libs-snapshot/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'.
> Could not GET 'http://repo.spring.io/libs-snapshot/org/springframework/boot/spring-boot-starter-data-elasticsearch/4.1.0-RC1/spring-boot-starter-data-elasticsearch-4.1.0-RC1.pom'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
解决方法
您需要引入4.1.0-RC1版本的Spring Data Elasticsearch,而不是启动启动器:
implementation group: 'org.springframework.data',name: 'spring-data-elasticsearch',version: '4.1.0-RC1'
可能还需要引入RC版本的Spring Data Commons:
implementation group: 'org.springframework.data',name: 'spring-data-commons',version: '2.4.0-RC1'