From abe75e0999647ef585db0500b5eb074628b43c6a Mon Sep 17 00:00:00 2001 From: FANNG Date: Fri, 17 Jan 2025 16:37:24 +0800 Subject: [PATCH] [#6307] feat(flink): remove log4j from Gravitino Flink connector (#6308) ### What changes were proposed in this pull request? remove log4j from Gravitino Flink connector ### Why are the changes needed? Fix: #6307 ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? setup an local flink cluster, run flink SQL --- flink-connector/flink-runtime/build.gradle.kts | 8 ++++++++ flink-connector/flink/build.gradle.kts | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/flink-connector/flink-runtime/build.gradle.kts b/flink-connector/flink-runtime/build.gradle.kts index 1a71646444e..0ac393dedf9 100644 --- a/flink-connector/flink-runtime/build.gradle.kts +++ b/flink-connector/flink-runtime/build.gradle.kts @@ -41,6 +41,14 @@ val scalaVersion: String = "2.12" val artifactName = "gravitino-${project.name}_$scalaVersion" val baseName = "${rootProject.name}-flink-connector-runtime-${flinkMajorVersion}_$scalaVersion" +configurations.all { + resolutionStrategy.eachDependency { + if (requested.group == "org.apache.logging.log4j") { + throw GradleException("Forbidden dependency 'org.apache.logging.log4j' found!") + } + } +} + dependencies { implementation(project(":clients:client-java-runtime", configuration = "shadow")) implementation(project(":flink-connector:flink")) diff --git a/flink-connector/flink/build.gradle.kts b/flink-connector/flink/build.gradle.kts index 4c9bd036ae9..6cbfbfa53b4 100644 --- a/flink-connector/flink/build.gradle.kts +++ b/flink-connector/flink/build.gradle.kts @@ -41,8 +41,12 @@ val scalaVersion: String = "2.12" val artifactName = "${rootProject.name}-flink-${flinkMajorVersion}_$scalaVersion" dependencies { - implementation(project(":core")) - implementation(project(":catalogs:catalog-common")) + implementation(project(":core")) { + exclude("org.apache.logging.log4j") + } + implementation(project(":catalogs:catalog-common")) { + exclude("org.apache.logging.log4j") + } implementation(libs.guava) compileOnly(project(":clients:client-java-runtime", configuration = "shadow"))