Skip to content

Commit 991457c

Browse files
committed
[SPARK-53650] Make build.gradle and libs.versions.toml up-to-date with okhttp3 usage
### What changes were proposed in this pull request? This PR aims to validate and update the Gradle build dependencies in terms of `okhttp3` library usage. ``` gradle/libs.versions.toml spark-operator-api/build.gradle spark-operator/build.gradle ``` ### Why are the changes needed? - As of now, `okhttp3` is a test dependency. So, we need to move `okhttp` to the test dependency section like `junit`. https://github.com/apache/spark-kubernetes-operator/blob/b0d7d9592ba15b37c067657c929d44f9c2ff5d88/gradle/libs.versions.toml#L21-L27 - Since SPARK-52005, `Apache Spark K8s Operator` is using `Apache Spark 4` dependency which has no direct dependency to `okhttp3` library. So, we don't need the following exclusion. https://github.com/apache/spark-kubernetes-operator/blob/b0d7d9592ba15b37c067657c929d44f9c2ff5d88/spark-operator/build.gradle#L69 - Since `Fabric8` v7.0.0, `VertxHttpClientFactory` is the default so that we don't need to exclude `okhttp3`. In addition, we migrated to use `VertxHttpClientFactory` via SPARK-53648. https://github.com/apache/spark-kubernetes-operator/blob/b0d7d9592ba15b37c067657c929d44f9c2ff5d88/spark-operator-api/build.gradle#L20-L23 ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs and manual check. **BEFORE** ``` $ git grep okhttp gradle/libs.versions.toml:okhttp = "4.12.0" gradle/libs.versions.toml:okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } gradle/libs.versions.toml:mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" } spark-operator-api/build.gradle: exclude group: 'com.squareup.okhttp3' spark-operator/build.gradle: exclude group: 'com.squareup.okhttp3' spark-operator/build.gradle: exclude group: 'com.squareup.okhttp3' spark-operator/build.gradle: exclude group: 'com.squareup.okhttp3' ``` **AFTER** ``` $ git grep okhttp gradle/libs.versions.toml:okhttp = "4.12.0" gradle/libs.versions.toml:mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" } ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#329 from dongjoon-hyun/SPARK-53650. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 7bad413 commit 991457c

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
fabric8 = "7.4.0"
1919
lombok = "1.18.38"
2020
operator-sdk = "5.1.2"
21-
okhttp = "4.12.0"
2221
dropwizard-metrics = "4.2.30"
2322
spark = "4.0.1"
2423
log4j = "2.24.3"
@@ -27,6 +26,7 @@ log4j = "2.24.3"
2726
junit = "5.13.1"
2827
jacoco = "0.8.13"
2928
mockito = "5.18.0"
29+
okhttp = "4.12.0"
3030

3131
# Build Analysis
3232
checkstyle = "10.23.1"
@@ -44,7 +44,6 @@ kubernetes-httpclient-vertx = { group = "io.fabric8", name = "kubernetes-httpcli
4444
kubernetes-server-mock = { group = "io.fabric8", name = "kubernetes-server-mock", version.ref = "fabric8" }
4545
kube-api-test-client-inject = {group = "io.fabric8", name = "kube-api-test-client-inject", version.ref = "fabric8"}
4646
crd-generator-apt = { group = "io.fabric8", name = "crd-generator-apt", version.ref = "fabric8" }
47-
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
4847
mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" }
4948
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok" }
5049
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }

spark-operator-api/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
*/
1919
dependencies {
2020
// fabric8
21-
implementation(libs.kubernetes.client) {
22-
exclude group: 'com.squareup.okhttp3'
23-
}
21+
implementation(libs.kubernetes.client)
2422
compileOnly(libs.crd.generator.apt)
2523
annotationProcessor(libs.crd.generator.apt)
2624

spark-operator/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ dependencies {
4848
exclude group: "org.rocksdb"
4949
exclude group: "org.slf4j"
5050
exclude group: "org.xerial.snappy"
51-
exclude group: 'com.squareup.okhttp3'
52-
exclude group: 'com.squareup.okio'
5351
}
5452
compileOnly(libs.lombok)
5553

@@ -62,11 +60,8 @@ dependencies {
6260
}
6361
testImplementation(libs.kubernetes.server.mock) {
6462
exclude group: 'junit'
65-
exclude group: 'com.squareup.okhttp3'
6663
}
6764
testImplementation(libs.spark.core) {
68-
exclude group: 'com.squareup.okio'
69-
exclude group: 'com.squareup.okhttp3'
7065
exclude group: "org.apache.logging.log4j"
7166
exclude group: "org.slf4j"
7267
}

0 commit comments

Comments
 (0)