Skip to content

Commit e83dad2

Browse files
authored
[Gradle] Simple fix the dependencies in test-framework (#134746) (#134780)
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 aa47d55 commit e83dad2

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
@@ -10,6 +10,15 @@
1010
apply plugin: 'elasticsearch.build'
1111
apply plugin: 'elasticsearch.publish'
1212

13+
configurations {
14+
// we do not want to expose a version conflict in transitive dependencies by
15+
// bringing in different versions of hamcrest and hamcrest-core.
16+
// Therefore we exclude transitive deps on hamcrest-core here as we have a direct
17+
// dependency on a newer version.
18+
runtimeElements {
19+
exclude group: 'org.hamcrest', module: 'hamcrest-core'
20+
}
21+
}
1322
dependencies {
1423
api project(":client:rest")
1524
api project(':modules:transport-netty4')
@@ -18,9 +27,13 @@ dependencies {
1827
api project(":libs:cli")
1928
api project(":libs:entitlement:bridge")
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)