Skip to content

Commit ba2306c

Browse files
authored
[Test] Use version range for elasticsearch-java (#127510) (#127705)
Snapshot builds of elasticsearch-java are no longer available. Using the current major highest version should be safe according to the compatibility guarantees described on https://github.com/elastic/elasticsearch-java?tab=readme-ov-file#compatibility Additionally, reorganize Maven repository configuration in build.gradle Repo https://snapshots.elastic.co/maven/ is no longer needed in a composite build. Previously it was only used to provide snapshot version of `elasticsearch-java` client which is no longer available in snapshot version. We keep the https://snapshots.elastic.co/maven/ repo to be used when for non-composite builds when any other dependencies snapshot versions can be fetched.
1 parent 570fc8f commit ba2306c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

plugins/examples/build.gradle

+3-9
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,16 @@ subprojects {
2222

2323
repositories {
2424
// Only necessary when building plugins against SNAPSHOT versions of Elasticsearch
25-
maven {
26-
url = 'https://snapshots.elastic.co/maven/'
27-
mavenContent {
28-
if (gradle.includedBuilds) {
29-
// When building in a composite, restrict this to only resolve the Java REST client
30-
includeModule 'co.elastic.clients', 'elasticsearch-java'
31-
}
32-
}
33-
}
3425
if (gradle.includedBuilds.isEmpty()) {
3526
maven {
3627
url = "https://artifacts-snapshot.elastic.co/elasticsearch/${elasticsearchVersion}/maven"
3728
mavenContent {
3829
includeModule 'org.elasticsearch', 'elasticsearch'
3930
}
4031
}
32+
maven {
33+
url = 'https://snapshots.elastic.co/maven/'
34+
}
4135
}
4236

4337
// Same for Lucene, add the snapshot repo based on the currently used Lucene version

plugins/examples/security-authorization-engine/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies {
1616
testImplementation "org.elasticsearch.plugin:x-pack-core:${elasticsearchVersion}"
1717
javaRestTestImplementation "org.elasticsearch.plugin:x-pack-core:${elasticsearchVersion}"
1818
javaRestTestImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
19-
javaRestTestImplementation("co.elastic.clients:elasticsearch-java:${elasticsearchVersion}")
19+
javaRestTestImplementation "co.elastic.clients:elasticsearch-java:[8.0,9.0)"
2020
javaRestTestImplementation "org.elasticsearch.client:elasticsearch-rest-client:${elasticsearchVersion}"
2121
javaRestTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
2222
javaRestTestImplementation "org.elasticsearch.test:framework:${elasticsearchVersion}"

0 commit comments

Comments
 (0)