This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new cdf1abb  [SPARK-53782] Use `slf4j-api` as a direct dependency
cdf1abb is described below

commit cdf1abbcf2a65d8341b037e380bd8f953f146c7c
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed Oct 1 20:42:00 2025 -0700

    [SPARK-53782] Use `slf4j-api` as a direct dependency
    
    ### What changes were proposed in this pull request?
    
    This PR aims to use `slf4j-api` as a direct dependency.
    
    ### Why are the changes needed?
    
    Previously, `slf4j-api` is implicitly determined by the transitive 
dependecies. We had better control directly by simplifying the dependency 
relationship with `slf4j-api`.
    
    **BEFORE**
    
    ```
    $ gradle spark-operator:dependencies --configuration compileClasspath | 
grep slf4j-api
    |    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.17
    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.17
    |    |    \--- org.slf4j:slf4j-api:2.0.17
    |    \--- org.slf4j:slf4j-api:2.0.17
    |    |    |    |    +--- org.slf4j:slf4j-api:2.0.17
    |    |    +--- org.slf4j:slf4j-api:2.0.17
    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.17
    ```
    
    **AFTER**
    
    ```
    $ gradle spark-operator:dependencies --configuration compileClasspath | 
grep slf4j-api
    |    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.17
    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.17
    |    |    \--- org.slf4j:slf4j-api:2.0.17
    |    \--- org.slf4j:slf4j-api:2.0.17
    |    |    |    |    +--- org.slf4j:slf4j-api:2.0.17
    |    |    +--- org.slf4j:slf4j-api:2.0.17
    +--- org.slf4j:slf4j-api:2.0.17
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #362 from dongjoon-hyun/SPARK-53782.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 gradle/libs.versions.toml       | 2 ++
 spark-operator-api/build.gradle | 5 ++++-
 spark-operator/build.gradle     | 5 ++++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 226ee34..0212b7a 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -21,6 +21,7 @@ operator-sdk = "5.1.3"
 dropwizard-metrics = "4.2.33"
 spark = "4.0.1"
 log4j = "2.24.3"
+slf4j = "2.0.17"
 
 # Test
 junit = "5.13.4"
@@ -50,6 +51,7 @@ log4j-core = { group = "org.apache.logging.log4j", name = 
"log4j-core", version.
 log4j-slf4j-impl = { group = "org.apache.logging.log4j", name = 
"log4j-slf4j-impl", version.ref = "log4j" }
 log4j-api12 = { group = "org.apache.logging.log4j", name = "log4j-1.2-api", 
version.ref = "log4j" }
 log4j-layout-template-json = { group = "org.apache.logging.log4j", name = 
"log4j-layout-template-json", version.ref = "log4j" }
+slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
 operator-framework = { group = "io.javaoperatorsdk", name = 
"operator-framework", version.ref = "operator-sdk"}
 operator-framework-junit5 = { group = "io.javaoperatorsdk", name = 
"operator-framework-junit-5", version.ref = "operator-sdk"}
 spotbugs-annotations = { group = "com.github.spotbugs", name = 
"spotbugs-annotations", version.ref = "spotbugs-tool"}
diff --git a/spark-operator-api/build.gradle b/spark-operator-api/build.gradle
index de33545..9db7d56 100644
--- a/spark-operator-api/build.gradle
+++ b/spark-operator-api/build.gradle
@@ -27,8 +27,11 @@ dependencies {
   annotationProcessor(libs.lombok)
 
   // logging
-  implementation(libs.log4j.slf4j.impl)
+  implementation(libs.log4j.slf4j.impl) {
+    exclude group: 'org.slf4j'
+  }
   implementation(libs.log4j.core)
+  implementation(libs.slf4j.api)
 
   testImplementation(platform(libs.junit.bom))
   testImplementation(libs.junit.jupiter)
diff --git a/spark-operator/build.gradle b/spark-operator/build.gradle
index f5b79e2..a7ceb8f 100644
--- a/spark-operator/build.gradle
+++ b/spark-operator/build.gradle
@@ -31,9 +31,12 @@ dependencies {
   // logging
   implementation(libs.log4j.api)
   implementation(libs.log4j.core)
-  implementation(libs.log4j.slf4j.impl)
+  implementation(libs.log4j.slf4j.impl) {
+    exclude group: 'org.slf4j'
+  }
   implementation(libs.log4j.api12)
   implementation(libs.log4j.layout.template.json)
+  implementation(libs.slf4j.api)
 
   // metrics
   implementation(libs.metrics.core)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to