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

yihua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new c92ea8a8bb [HUDI-4810] Fixing Hudi bundles requiring log4j2 on the 
classpath (#6631)
c92ea8a8bb is described below

commit c92ea8a8bb80d0bedba8554bb2f3b9fc423379d8
Author: Alexey Kudinkin <[email protected]>
AuthorDate: Fri Sep 9 17:23:28 2022 -0700

    [HUDI-4810] Fixing Hudi bundles requiring log4j2 on the classpath (#6631)
    
    Downgrading all of the log4j2 deps to "provided" scope, since these are not 
API modules (as advertised), but rather fully-fledged implementations adding 
dependency on other modules (like log4j2 in the case of "log4j-1.2-api")
---
 hudi-aws/pom.xml                                   |  6 +++++
 hudi-cli/pom.xml                                   |  6 +++++
 hudi-client/hudi-client-common/pom.xml             |  6 +++++
 hudi-client/hudi-flink-client/pom.xml              | 16 ++++++++++-
 hudi-client/hudi-java-client/pom.xml               |  6 +++++
 hudi-client/hudi-spark-client/pom.xml              |  6 +++++
 hudi-common/pom.xml                                | 18 +------------
 hudi-examples/hudi-examples-java/pom.xml           |  7 +++++
 hudi-examples/hudi-examples-spark/pom.xml          | 13 +++++----
 hudi-flink-datasource/hudi-flink/pom.xml           | 14 ++++++++++
 hudi-flink-datasource/hudi-flink1.13.x/pom.xml     | 15 +++++++++++
 hudi-flink-datasource/hudi-flink1.14.x/pom.xml     | 15 +++++++++++
 hudi-flink-datasource/hudi-flink1.15.x/pom.xml     | 15 +++++++++++
 hudi-gcp/pom.xml                                   |  6 +++++
 hudi-hadoop-mr/pom.xml                             |  6 +++++
 hudi-integ-test/pom.xml                            |  3 +--
 hudi-kafka-connect/pom.xml                         |  7 -----
 hudi-spark-datasource/hudi-spark-common/pom.xml    |  6 +++++
 hudi-spark-datasource/hudi-spark/pom.xml           |  6 +++++
 hudi-spark-datasource/hudi-spark3.2.x/pom.xml      |  8 ++++++
 .../test/resources/log4j-surefire-quiet.properties | 30 ---------------------
 .../src/test/resources/log4j-surefire.properties   | 31 ----------------------
 hudi-sync/hudi-adb-sync/pom.xml                    | 11 ++++++--
 hudi-sync/hudi-datahub-sync/pom.xml                |  7 -----
 hudi-sync/hudi-hive-sync/pom.xml                   | 15 +++++------
 hudi-sync/hudi-sync-common/pom.xml                 |  9 +++++++
 hudi-tests-common/pom.xml                          | 20 ++++++++++++--
 hudi-timeline-service/pom.xml                      | 13 +++++----
 hudi-utilities/pom.xml                             |  3 +--
 packaging/hudi-integ-test-bundle/pom.xml           | 18 -------------
 packaging/hudi-kafka-connect-bundle/pom.xml        | 14 ----------
 packaging/hudi-timeline-server-bundle/pom.xml      |  7 -----
 pom.xml                                            |  9 +++++++
 33 files changed, 212 insertions(+), 160 deletions(-)

diff --git a/hudi-aws/pom.xml b/hudi-aws/pom.xml
index eac2c60d30..c634102550 100644
--- a/hudi-aws/pom.xml
+++ b/hudi-aws/pom.xml
@@ -34,6 +34,12 @@
     </properties>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+
         <!-- Hoodie -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
diff --git a/hudi-cli/pom.xml b/hudi-cli/pom.xml
index 0910d94c82..2bc5213f22 100644
--- a/hudi-cli/pom.xml
+++ b/hudi-cli/pom.xml
@@ -139,6 +139,12 @@
       <version>${scala.version}</version>
     </dependency>
 
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hoodie -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-client/hudi-client-common/pom.xml 
b/hudi-client/hudi-client-common/pom.xml
index 031a9ee6a3..9757e95c3b 100644
--- a/hudi-client/hudi-client-common/pom.xml
+++ b/hudi-client/hudi-client-common/pom.xml
@@ -30,6 +30,12 @@
   <packaging>jar</packaging>
 
   <dependencies>
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hoodie -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-client/hudi-flink-client/pom.xml 
b/hudi-client/hudi-flink-client/pom.xml
index a3c72e0dab..47280bf72d 100644
--- a/hudi-client/hudi-flink-client/pom.xml
+++ b/hudi-client/hudi-flink-client/pom.xml
@@ -35,7 +35,21 @@
     </properties>
 
     <dependencies>
-        <!-- Hudi  -->
+        <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
+    <!-- Hudi  -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
             <artifactId>hudi-client-common</artifactId>
diff --git a/hudi-client/hudi-java-client/pom.xml 
b/hudi-client/hudi-java-client/pom.xml
index f487a4aa68..4eee515578 100644
--- a/hudi-client/hudi-java-client/pom.xml
+++ b/hudi-client/hudi-java-client/pom.xml
@@ -30,6 +30,12 @@
     <packaging>jar</packaging>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+
         <!-- Hudi  -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
diff --git a/hudi-client/hudi-spark-client/pom.xml 
b/hudi-client/hudi-spark-client/pom.xml
index 19d49f5d33..8d913d60ca 100644
--- a/hudi-client/hudi-spark-client/pom.xml
+++ b/hudi-client/hudi-spark-client/pom.xml
@@ -37,6 +37,12 @@
       <version>${scala.version}</version>
     </dependency>
 
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hudi  -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-common/pom.xml b/hudi-common/pom.xml
index bfbfdee776..d3f37864e3 100644
--- a/hudi-common/pom.xml
+++ b/hudi-common/pom.xml
@@ -101,27 +101,11 @@
   </build>
 
   <dependencies>
-    <!-- Logging dependencies -->
+    <!-- Logging -->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-slf4j-impl</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jul-to-slf4j</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
 
     <!-- Fasterxml -->
     <dependency>
diff --git a/hudi-examples/hudi-examples-java/pom.xml 
b/hudi-examples/hudi-examples-java/pom.xml
index 2f4fa61801..001e8ada9e 100644
--- a/hudi-examples/hudi-examples-java/pom.xml
+++ b/hudi-examples/hudi-examples-java/pom.xml
@@ -108,6 +108,13 @@
     </build>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+
+        <!-- Hudi -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
             <artifactId>hudi-examples-common</artifactId>
diff --git a/hudi-examples/hudi-examples-spark/pom.xml 
b/hudi-examples/hudi-examples-spark/pom.xml
index 1b5e9a1455..6e2b2f4069 100644
--- a/hudi-examples/hudi-examples-spark/pom.xml
+++ b/hudi-examples/hudi-examples-spark/pom.xml
@@ -108,12 +108,20 @@
     </build>
 
     <dependencies>
+        <!-- Scala -->
         <dependency>
             <groupId>org.scala-lang</groupId>
             <artifactId>scala-library</artifactId>
             <version>${scala.version}</version>
         </dependency>
 
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+
+        <!-- Hudi -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
             <artifactId>hudi-examples-common</artifactId>
@@ -236,11 +244,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        <!-- Logging dependencies -->
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-core</artifactId>
-        </dependency>
 
         <!-- Junit dependencies -->
         <dependency>
diff --git a/hudi-flink-datasource/hudi-flink/pom.xml 
b/hudi-flink-datasource/hudi-flink/pom.xml
index b87915480e..a3ab958bf7 100644
--- a/hudi-flink-datasource/hudi-flink/pom.xml
+++ b/hudi-flink-datasource/hudi-flink/pom.xml
@@ -75,6 +75,20 @@
     </build>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
         <!-- Hoodie -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
diff --git a/hudi-flink-datasource/hudi-flink1.13.x/pom.xml 
b/hudi-flink-datasource/hudi-flink1.13.x/pom.xml
index 8cb923b4e1..ac3ae5753d 100644
--- a/hudi-flink-datasource/hudi-flink1.13.x/pom.xml
+++ b/hudi-flink-datasource/hudi-flink1.13.x/pom.xml
@@ -33,6 +33,21 @@
     </properties>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- Hudi -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
             <artifactId>hudi-common</artifactId>
diff --git a/hudi-flink-datasource/hudi-flink1.14.x/pom.xml 
b/hudi-flink-datasource/hudi-flink1.14.x/pom.xml
index cef0e2b839..007b754b10 100644
--- a/hudi-flink-datasource/hudi-flink1.14.x/pom.xml
+++ b/hudi-flink-datasource/hudi-flink1.14.x/pom.xml
@@ -33,6 +33,21 @@
     </properties>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- Hudi -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
             <artifactId>hudi-common</artifactId>
diff --git a/hudi-flink-datasource/hudi-flink1.15.x/pom.xml 
b/hudi-flink-datasource/hudi-flink1.15.x/pom.xml
index a9c2519736..bd97dce1a6 100644
--- a/hudi-flink-datasource/hudi-flink1.15.x/pom.xml
+++ b/hudi-flink-datasource/hudi-flink1.15.x/pom.xml
@@ -33,6 +33,21 @@
     </properties>
 
     <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- Hudi -->
         <dependency>
             <groupId>org.apache.hudi</groupId>
             <artifactId>hudi-common</artifactId>
diff --git a/hudi-gcp/pom.xml b/hudi-gcp/pom.xml
index 3a93fa5738..b7d28f514e 100644
--- a/hudi-gcp/pom.xml
+++ b/hudi-gcp/pom.xml
@@ -44,6 +44,12 @@ See 
https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google
   </dependencyManagement>
 
   <dependencies>
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hoodie -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-hadoop-mr/pom.xml b/hudi-hadoop-mr/pom.xml
index 720b17654d..047f040943 100644
--- a/hudi-hadoop-mr/pom.xml
+++ b/hudi-hadoop-mr/pom.xml
@@ -30,6 +30,12 @@
   </properties>
 
   <dependencies>
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hudi -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-integ-test/pom.xml b/hudi-integ-test/pom.xml
index a63bf44223..911daada76 100644
--- a/hudi-integ-test/pom.xml
+++ b/hudi-integ-test/pom.xml
@@ -166,8 +166,7 @@
     <!-- Logging -->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <scope>compile</scope>
+      <artifactId>log4j-1.2-api</artifactId>
     </dependency>
 
     <!-- Hoodie - Import -->
diff --git a/hudi-kafka-connect/pom.xml b/hudi-kafka-connect/pom.xml
index d32d0fffe7..7a0bf7ac07 100644
--- a/hudi-kafka-connect/pom.xml
+++ b/hudi-kafka-connect/pom.xml
@@ -153,13 +153,6 @@
             <artifactId>protobuf-java</artifactId>
             <version>${proto.version}</version>
         </dependency>
-
-        <!-- Logging -->
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-core</artifactId>
-            <scope>compile</scope>
-        </dependency>
         
         <!-- Fasterxml -->
         <dependency>
diff --git a/hudi-spark-datasource/hudi-spark-common/pom.xml 
b/hudi-spark-datasource/hudi-spark-common/pom.xml
index 27bb1405b9..2ab2b24e74 100644
--- a/hudi-spark-datasource/hudi-spark-common/pom.xml
+++ b/hudi-spark-datasource/hudi-spark-common/pom.xml
@@ -149,6 +149,12 @@
       <version>${scala.version}</version>
     </dependency>
 
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hoodie -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-spark-datasource/hudi-spark/pom.xml 
b/hudi-spark-datasource/hudi-spark/pom.xml
index 035c099c3a..ddce2ae637 100644
--- a/hudi-spark-datasource/hudi-spark/pom.xml
+++ b/hudi-spark-datasource/hudi-spark/pom.xml
@@ -172,6 +172,12 @@
       <version>${scala.version}</version>
     </dependency>
 
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hoodie -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
diff --git a/hudi-spark-datasource/hudi-spark3.2.x/pom.xml 
b/hudi-spark-datasource/hudi-spark3.2.x/pom.xml
index 77da0000d4..4506451521 100644
--- a/hudi-spark-datasource/hudi-spark3.2.x/pom.xml
+++ b/hudi-spark-datasource/hudi-spark3.2.x/pom.xml
@@ -248,6 +248,14 @@
       </exclusions>
     </dependency>
 
+    <!-- Hoodie - Test -->
+    <dependency>
+      <groupId>org.apache.hudi</groupId>
+      <artifactId>hudi-tests-common</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.json4s</groupId>
       <artifactId>json4s-jackson_${scala.binary.version}</artifactId>
diff --git 
a/hudi-spark-datasource/hudi-spark3.3.x/src/test/resources/log4j-surefire-quiet.properties
 
b/hudi-spark-datasource/hudi-spark3.3.x/src/test/resources/log4j-surefire-quiet.properties
deleted file mode 100644
index ca0a50c842..0000000000
--- 
a/hudi-spark-datasource/hudi-spark3.3.x/src/test/resources/log4j-surefire-quiet.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-###
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-###
-log4j.rootLogger=WARN, CONSOLE
-log4j.logger.org.apache.hudi=DEBUG
-log4j.logger.org.apache.hadoop.hbase=ERROR
-
-# CONSOLE is set to be a ConsoleAppender.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-# CONSOLE uses PatternLayout.
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d %c %x - %m%n
-log4j.appender.CONSOLE.filter.a=org.apache.log4j.varia.LevelRangeFilter
-log4j.appender.CONSOLE.filter.a.AcceptOnMatch=true
-log4j.appender.CONSOLE.filter.a.LevelMin=WARN
-log4j.appender.CONSOLE.filter.a.LevelMax=FATAL
diff --git 
a/hudi-spark-datasource/hudi-spark3.3.x/src/test/resources/log4j-surefire.properties
 
b/hudi-spark-datasource/hudi-spark3.3.x/src/test/resources/log4j-surefire.properties
deleted file mode 100644
index 14bbb08972..0000000000
--- 
a/hudi-spark-datasource/hudi-spark3.3.x/src/test/resources/log4j-surefire.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-###
-log4j.rootLogger=WARN, CONSOLE
-log4j.logger.org.apache=INFO
-log4j.logger.org.apache.hudi=DEBUG
-log4j.logger.org.apache.hadoop.hbase=ERROR
-
-# CONSOLE is set to be a ConsoleAppender.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-# CONSOLE uses PatternLayout.
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-log4j.appender.CONSOLE.filter.a=org.apache.log4j.varia.LevelRangeFilter
-log4j.appender.CONSOLE.filter.a.AcceptOnMatch=true
-log4j.appender.CONSOLE.filter.a.LevelMin=WARN
-log4j.appender.CONSOLE.filter.a.LevelMax=FATAL
diff --git a/hudi-sync/hudi-adb-sync/pom.xml b/hudi-sync/hudi-adb-sync/pom.xml
index fc2f914e8e..dd15ebed3d 100644
--- a/hudi-sync/hudi-adb-sync/pom.xml
+++ b/hudi-sync/hudi-adb-sync/pom.xml
@@ -99,8 +99,15 @@
     <!-- Logging -->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <scope>compile</scope>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
     </dependency>
 
     <dependency>
diff --git a/hudi-sync/hudi-datahub-sync/pom.xml 
b/hudi-sync/hudi-datahub-sync/pom.xml
index 08b13b55fb..522c05e636 100644
--- a/hudi-sync/hudi-datahub-sync/pom.xml
+++ b/hudi-sync/hudi-datahub-sync/pom.xml
@@ -68,13 +68,6 @@
       <version>${http.version}</version>
     </dependency>
 
-    <!-- Logging -->
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <scope>compile</scope>
-    </dependency>
-
     <dependency>
       <groupId>org.apache.parquet</groupId>
       <artifactId>parquet-avro</artifactId>
diff --git a/hudi-sync/hudi-hive-sync/pom.xml b/hudi-sync/hudi-hive-sync/pom.xml
index 738bd218e9..dde36c4704 100644
--- a/hudi-sync/hudi-hive-sync/pom.xml
+++ b/hudi-sync/hudi-hive-sync/pom.xml
@@ -35,8 +35,14 @@
   </properties>
 
   <dependencies>
+    <!-- TODO add standalone hudi-hive-sync-cli project -->
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
 
-    <!-- Hoodie -->
+    <!-- Hudi -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
       <artifactId>hudi-common</artifactId>
@@ -53,13 +59,6 @@
       <version>${project.version}</version>
     </dependency>
 
-    <!-- Logging -->
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <scope>compile</scope>
-    </dependency>
-
     <dependency>
       <groupId>org.apache.parquet</groupId>
       <artifactId>parquet-avro</artifactId>
diff --git a/hudi-sync/hudi-sync-common/pom.xml 
b/hudi-sync/hudi-sync-common/pom.xml
index 84d20f893f..df31e860ca 100644
--- a/hudi-sync/hudi-sync-common/pom.xml
+++ b/hudi-sync/hudi-sync-common/pom.xml
@@ -32,15 +32,24 @@
   </properties>
 
   <dependencies>
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
+    <!-- Hudi -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
       <artifactId>hudi-common</artifactId>
       <version>${project.version}</version>
     </dependency>
+
     <dependency>
         <groupId>org.apache.parquet</groupId>
       <artifactId>parquet-avro</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
diff --git a/hudi-tests-common/pom.xml b/hudi-tests-common/pom.xml
index e66569c64d..bd273201aa 100644
--- a/hudi-tests-common/pom.xml
+++ b/hudi-tests-common/pom.xml
@@ -45,23 +45,39 @@
     </build>
 
     <dependencies>
-        <!-- All modules will need to include log4j-core during test runtime 
to properly log -->
+        <!-- Logging -->
+        <!-- NOTE: All of the modules below have scope of "compile" to make 
sure Hudi relies on
+                   Log4j2 implementation in its tests -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-1.2-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-core</artifactId>
             <scope>compile</scope>
         </dependency>
-        <!-- Add some logging bridges that are needed at runtime for tests -->
+
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>compile</scope>
         </dependency>
+
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>jul-to-slf4j</artifactId>
             <scope>compile</scope>
         </dependency>
+
         <!-- Required for groups/excludeGroups support in the maven surefire 
plugin -->
         <dependency>
             <groupId>org.junit.jupiter</groupId>
diff --git a/hudi-timeline-service/pom.xml b/hudi-timeline-service/pom.xml
index ff5b8dfe7a..ddff6e6fd9 100644
--- a/hudi-timeline-service/pom.xml
+++ b/hudi-timeline-service/pom.xml
@@ -68,6 +68,12 @@
   </build>
 
   <dependencies>
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+
     <!-- Hoodie -->
     <dependency>
       <groupId>org.apache.hudi</groupId>
@@ -75,13 +81,6 @@
       <version>${project.version}</version>
     </dependency>
 
-    <!-- Logging -->
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <scope>compile</scope>
-    </dependency>
-
     <!-- Fasterxml -->
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
diff --git a/hudi-utilities/pom.xml b/hudi-utilities/pom.xml
index b6a5495e15..a4690fd3f9 100644
--- a/hudi-utilities/pom.xml
+++ b/hudi-utilities/pom.xml
@@ -203,8 +203,7 @@
     <!-- Logging -->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <scope>compile</scope>
+      <artifactId>log4j-1.2-api</artifactId>
     </dependency>
 
     <!-- Fasterxml -->
diff --git a/packaging/hudi-integ-test-bundle/pom.xml 
b/packaging/hudi-integ-test-bundle/pom.xml
index 9f9193b5eb..84aee680a6 100644
--- a/packaging/hudi-integ-test-bundle/pom.xml
+++ b/packaging/hudi-integ-test-bundle/pom.xml
@@ -645,24 +645,6 @@
       <artifactId>httpcore</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-1.2-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <version>${slf4j.version}</version>
-    </dependency>
-
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-mapreduce-client-common</artifactId>
diff --git a/packaging/hudi-kafka-connect-bundle/pom.xml 
b/packaging/hudi-kafka-connect-bundle/pom.xml
index 357cc4ceba..cb63e7a5f2 100644
--- a/packaging/hudi-kafka-connect-bundle/pom.xml
+++ b/packaging/hudi-kafka-connect-bundle/pom.xml
@@ -281,20 +281,6 @@
             <artifactId>hudi-kafka-connect</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.logging.log4j</groupId>
-                    <artifactId>log4j-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.apache.logging.log4j</groupId>
-                    <artifactId>log4j-core</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.apache.logging.log4j</groupId>
-                    <artifactId>log4j-1.2-api</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.hudi</groupId>
diff --git a/packaging/hudi-timeline-server-bundle/pom.xml 
b/packaging/hudi-timeline-server-bundle/pom.xml
index a8a0253a4a..0a2a3b50f0 100644
--- a/packaging/hudi-timeline-server-bundle/pom.xml
+++ b/packaging/hudi-timeline-server-bundle/pom.xml
@@ -42,13 +42,6 @@
             <version>${project.version}</version>
         </dependency>
 
-        <!-- Logging -->
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-core</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
         <!-- Fasterxml -->
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
diff --git a/pom.xml b/pom.xml
index 7c55aecefc..b5c9116a97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -613,10 +613,15 @@
   <dependencyManagement>
     <dependencies>
       <!-- Logging -->
+      <!-- NOTE: All the following deps have to have "provided" scope to make 
sure these are not conflicting
+           w/ implementations that are using Hudi as a library. For ex, all 
Spark < 3.3 are still relying on Log4j1
+           and therefore if we be bringing Log4j2 bridge for V1 on the 
classpath (log4j-1.2-api), it'll fail w/
+           `ClassNotFoundException`, since the bridge would be expecting 
Log4j2 impl be present -->
       <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-api</artifactId>
         <version>${log4j2.version}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.logging.log4j</groupId>
@@ -628,21 +633,25 @@
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-1.2-api</artifactId>
         <version>${log4j2.version}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-slf4j-impl</artifactId>
         <version>${log4j2.version}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>${slf4j.version}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>jul-to-slf4j</artifactId>
         <version>${slf4j.version}</version>
+        <scope>provided</scope>
       </dependency>
 
       <!-- Fasterxml -->

Reply via email to