Skip to content

Commit 5dc10ba

Browse files
authored
[Gradle] Simple fix the dependencies in test-framework (#134746) (#134779)
The transitive dependencies in test-framework inheritely have a version conflict that results in a jarHell in our example builds. We fix that for now by excluding hamcrest-core for now as it has been in the past before we changed transitive dependency handling.
1 parent 050e739 commit 5dc10ba

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/framework/build.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ import org.elasticsearch.gradle.internal.info.BuildParams;
1111
apply plugin: 'elasticsearch.build'
1212
apply plugin: 'elasticsearch.publish'
1313

14+
configurations {
15+
// we do not want to expose a version conflict in transitive dependencies by
16+
// bringing in different versions of hamcrest and hamcrest-core.
17+
// Therefore we exclude transitive deps on hamcrest-core here as we have a direct
18+
// dependency on a newer version.
19+
runtimeElements {
20+
exclude group: 'org.hamcrest', module: 'hamcrest-core'
21+
}
22+
}
1423
dependencies {
1524
api project(":client:rest")
1625
api project(':modules:transport-netty4')
@@ -19,9 +28,13 @@ dependencies {
1928
api project(":libs:cli")
2029
api project(":libs:entitlement:bridge")
2130
api "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
22-
api "junit:junit:${versions.junit}"
31+
api("junit:junit:${versions.junit}") {
32+
// exclude group: 'org.hamcrest'
33+
}
2334
api "org.hamcrest:hamcrest:${versions.hamcrest}"
24-
api "org.apache.lucene:lucene-test-framework:${versions.lucene}"
35+
api("org.apache.lucene:lucene-test-framework:${versions.lucene}") {
36+
// exclude group: 'org.hamcrest'
37+
}
2538
api "org.apache.lucene:lucene-codecs:${versions.lucene}"
2639
api "commons-logging:commons-logging:${versions.commonslogging}"
2740
api "commons-codec:commons-codec:${versions.commonscodec}"

0 commit comments

Comments
 (0)