Skip to content

Commit af6f99d

Browse files
committed
Rework excluded transitive dependencies
1 parent 5c84e6b commit af6f99d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/framework/build.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ dependencies {
1717
api project(":server")
1818
api project(":libs:cli")
1919
api project(":libs:entitlement:bridge")
20-
api "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
20+
api ("com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}") {
21+
exclude group: "junit", module: "junit"
22+
}
2123

2224
// we do not want to expose a version conflict in transitive dependencies by
23-
// bringing in different versions of hamcrest and hamcrest-core.
24-
// Therefore we exclude transitive deps on hamcrest-core here as we have a direct
25-
// dependency on a newer version.
25+
// bringing in different versions of dependencies.
26+
// Therefore we exclude mismatches in our transitive dependencies explicitly.
27+
// This also avoids jarHell issues with different hamcrest related dependencies
28+
// like hamcrest and hamcrest-core
2629
api "org.hamcrest:hamcrest:${versions.hamcrest}"
2730
api("junit:junit:${versions.junit}") {
2831
exclude group: 'org.hamcrest', module: 'hamcrest-core'
2932
}
3033
api("org.apache.lucene:lucene-test-framework:${versions.lucene}") {
31-
exclude group: 'org.hamcrest', module: 'hamcrest-core'
34+
exclude group: "junit", module: "junit"
35+
exclude group: 'com.carrotsearch.randomizedtesting', module: 'randomizedtesting-runner'
3236
}
3337
api "org.apache.lucene:lucene-codecs:${versions.lucene}"
3438
api "commons-logging:commons-logging:${versions.commonslogging}"

0 commit comments

Comments
 (0)