Skip to content

Commit 4887ee5

Browse files
authored
[Gradle] Simple fix the dependencies in test-framework (#134746) (#134782)
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 394d31e commit 4887ee5

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,16 +11,29 @@ 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')
1726
api project(':libs:ssl-config')
1827
api project(":server")
1928
api project(":libs:cli")
2029
api "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
21-
api "junit:junit:${versions.junit}"
30+
api("junit:junit:${versions.junit}") {
31+
// exclude group: 'org.hamcrest'
32+
}
2233
api "org.hamcrest:hamcrest:${versions.hamcrest}"
23-
api "org.apache.lucene:lucene-test-framework:${versions.lucene}"
34+
api("org.apache.lucene:lucene-test-framework:${versions.lucene}") {
35+
// exclude group: 'org.hamcrest'
36+
}
2437
api "org.apache.lucene:lucene-codecs:${versions.lucene}"
2538
api "commons-logging:commons-logging:${versions.commonslogging}"
2639
api "commons-codec:commons-codec:${versions.commonscodec}"

0 commit comments

Comments
 (0)