Skip to content

Commit 746932d

Browse files
committed
MLE-17232 Ensuring logging works in Flux
slf4j-api 1.7.x was sneaking in from the Java Client. The Java Client will be updated to use 2.x. But this ensures that all dependencies use slf4j-api 2.x, which avoids the logging issue referenced in the comment. Also made a small optimization in shrinking the shadow jar size - we don't need any of the Jackson core dependencies for dataformat-xml, as Spark provides all of them.
1 parent 161ddc4 commit 746932d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ configurations {
3737
testImplementation.extendsFrom(compileOnly)
3838
}
3939

40+
configurations.all {
41+
// Ensures that slf4j-api 1.x does not appear on the Flux classpath in particular, which can lead to this
42+
// issue - https://www.slf4j.org/codes.html#StaticLoggerBinder .
43+
resolutionStrategy {
44+
force "org.slf4j:slf4j-api:2.0.13"
45+
}
46+
}
47+
4048
dependencies {
4149
// This is compileOnly as any environment this is used in will provide the Spark dependencies itself.
4250
compileOnly ('org.apache.spark:spark-sql_2.12:' + sparkVersion) {
@@ -53,7 +61,10 @@ dependencies {
5361
}
5462

5563
// Required for converting JSON to XML. Using 2.15.2 to align with Spark 3.5.3.
56-
shadowDependencies "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2"
64+
shadowDependencies ("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2") {
65+
// Not needed, as the modules in this group that this dependency depends on are all provided by Spark.
66+
exclude group: "com.fasterxml.jackson.core"
67+
}
5768

5869
// Need this so that an OkHttpClientConfigurator can be created.
5970
shadowDependencies 'com.squareup.okhttp3:okhttp:4.12.0'

0 commit comments

Comments
 (0)