Skip to content

Commit e15064f

Browse files
authored
[Gradle] Simple fix the dependencies in test-framework (#134746) (#134781)
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 37c039d commit e15064f

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

0 commit comments

Comments
 (0)