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

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


The following commit(s) were added to refs/heads/master by this push:
     new e0d972cc16f HDDS-14056. Relocate protobuf in ozone-filesystem shaded 
jars (#9412)
e0d972cc16f is described below

commit e0d972cc16f1a92b2631d0fabfdb2e85d33bd418
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Tue Dec 2 18:01:10 2025 +0100

    HDDS-14056. Relocate protobuf in ozone-filesystem shaded jars (#9412)
---
 hadoop-ozone/dev-support/checks/findbugs.sh       |   2 +-
 hadoop-ozone/dev-support/checks/javadoc.sh        |   2 +-
 hadoop-ozone/dev-support/checks/pmd.sh            |   2 +-
 hadoop-ozone/dist/pom.xml                         |   5 -
 hadoop-ozone/dist/src/main/license/jar-report.txt |   1 -
 hadoop-ozone/ozonefs-hadoop2/pom.xml              |  57 +++++++-
 hadoop-ozone/ozonefs-hadoop3-client/pom.xml       | 153 ----------------------
 hadoop-ozone/ozonefs-hadoop3/pom.xml              |   1 -
 hadoop-ozone/ozonefs-shaded/pom.xml               |  33 +++--
 hadoop-ozone/pom.xml                              |   1 -
 pom.xml                                           |  13 +-
 11 files changed, 80 insertions(+), 190 deletions(-)

diff --git a/hadoop-ozone/dev-support/checks/findbugs.sh 
b/hadoop-ozone/dev-support/checks/findbugs.sh
index 7bc3da4d537..2286815ef33 100755
--- a/hadoop-ozone/dev-support/checks/findbugs.sh
+++ b/hadoop-ozone/dev-support/checks/findbugs.sh
@@ -30,7 +30,7 @@ REPORT_FILE="$REPORT_DIR/summary.txt"
 source "${DIR}/_lib.sh"
 source "${DIR}/install/spotbugs.sh"
 
-MAVEN_OPTIONS='-B -fae -DskipDocs -DskipRecon --no-transfer-progress'
+MAVEN_OPTIONS='-B -fae -DskipDocs -DskipRecon -DskipShade 
--no-transfer-progress'
 
 if [[ "${OZONE_WITH_COVERAGE}" != "true" ]]; then
   MAVEN_OPTIONS="${MAVEN_OPTIONS} -Djacoco.skip"
diff --git a/hadoop-ozone/dev-support/checks/javadoc.sh 
b/hadoop-ozone/dev-support/checks/javadoc.sh
index dc98695a5bb..035f8700c4a 100755
--- a/hadoop-ozone/dev-support/checks/javadoc.sh
+++ b/hadoop-ozone/dev-support/checks/javadoc.sh
@@ -23,7 +23,7 @@ BASE_DIR="$(pwd -P)"
 REPORT_DIR=${OUTPUT_DIR:-"${BASE_DIR}/target/javadoc"}
 REPORT_FILE="$REPORT_DIR/summary.txt"
 
-MAVEN_OPTIONS="-B -fae -DskipDocs -DskipRecon --no-transfer-progress 
${MAVEN_OPTIONS:-}"
+MAVEN_OPTIONS="-B -fae -DskipDocs -DskipRecon -DskipShade 
--no-transfer-progress ${MAVEN_OPTIONS:-}"
 
 mvn ${MAVEN_OPTIONS} javadoc:aggregate "$@" | tee output.log
 rc=$?
diff --git a/hadoop-ozone/dev-support/checks/pmd.sh 
b/hadoop-ozone/dev-support/checks/pmd.sh
index be34f08282d..6f0afae7ce5 100755
--- a/hadoop-ozone/dev-support/checks/pmd.sh
+++ b/hadoop-ozone/dev-support/checks/pmd.sh
@@ -26,7 +26,7 @@ mkdir -p "$REPORT_DIR"
 
 REPORT_FILE="$REPORT_DIR/summary.txt"
 
-MAVEN_OPTIONS='-B -fae --no-transfer-progress -Dpmd.failOnViolation=false 
-Dpmd.printFailingErrors -DskipDocs -DskipRecon'
+MAVEN_OPTIONS='-B -fae --no-transfer-progress -Dpmd.failOnViolation=false 
-Dpmd.printFailingErrors -DskipDocs -DskipRecon -DskipShade'
 
 declare -i rc
 
diff --git a/hadoop-ozone/dist/pom.xml b/hadoop-ozone/dist/pom.xml
index ae3415cef4b..f3ef154e65c 100644
--- a/hadoop-ozone/dist/pom.xml
+++ b/hadoop-ozone/dist/pom.xml
@@ -273,11 +273,6 @@
           <artifactId>ozone-filesystem-hadoop3</artifactId>
           <scope>runtime</scope>
         </dependency>
-        <dependency>
-          <groupId>org.apache.ozone</groupId>
-          <artifactId>ozone-filesystem-hadoop3-client</artifactId>
-          <scope>runtime</scope>
-        </dependency>
       </dependencies>
     </profile>
 
diff --git a/hadoop-ozone/dist/src/main/license/jar-report.txt 
b/hadoop-ozone/dist/src/main/license/jar-report.txt
index efd83ca9d4f..f8b3b6ff6dc 100644
--- a/hadoop-ozone/dist/src/main/license/jar-report.txt
+++ b/hadoop-ozone/dist/src/main/license/jar-report.txt
@@ -223,7 +223,6 @@ share/ozone/lib/ozone-datanode.jar
 share/ozone/lib/ozone-filesystem-common.jar
 share/ozone/lib/ozone-filesystem-hadoop2.jar
 share/ozone/lib/ozone-filesystem-hadoop3.jar
-share/ozone/lib/ozone-filesystem-hadoop3-client.jar
 share/ozone/lib/ozone-filesystem.jar
 share/ozone/lib/ozone-freon.jar
 share/ozone/lib/ozone-httpfsgateway.jar
diff --git a/hadoop-ozone/ozonefs-hadoop2/pom.xml 
b/hadoop-ozone/ozonefs-hadoop2/pom.xml
index 4563c6873a9..8476851bc52 100644
--- a/hadoop-ozone/ozonefs-hadoop2/pom.xml
+++ b/hadoop-ozone/ozonefs-hadoop2/pom.xml
@@ -23,9 +23,6 @@
   <version>2.2.0-SNAPSHOT</version>
   <packaging>jar</packaging>
   <name>Apache Ozone FS Hadoop 2.x compatibility</name>
-  <properties>
-    <shaded.prefix>org.apache.hadoop.ozone.shaded</shaded.prefix>
-  </properties>
   <dependencies>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
@@ -113,6 +110,16 @@
         <configuration>
           <proc>none</proc>
         </configuration>
+        <executions>
+          <execution>
+            <id>default-compile</id>
+            <configuration>
+              <compileSourceRoots>
+                
<compileSourceRoot>${project.basedir}/target/generated-sources/java</compileSourceRoot>
+              </compileSourceRoots>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -159,6 +166,50 @@
           <onlyAnalyze>org.apache.hadoop.fs.ozone.*</onlyAnalyze>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <phase>generate-sources</phase>
+            <configuration>
+              <target>
+                <copy todir="target/generated-sources/java">
+                  <fileset dir="src/main/java" />
+                </copy>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>com.google.code.maven-replacer-plugin</groupId>
+        <artifactId>replacer</artifactId>
+        <executions>
+          <execution>
+            <id>replace-sources</id>
+            <goals>
+              <goal>replace</goal>
+            </goals>
+            <phase>process-sources</phase>
+            <configuration>
+              <basedir>${project.basedir}/target/generated-sources</basedir>
+              <includes>
+                <include>**/*.java</include>
+              </includes>
+              <replacements>
+                <replacement>
+                  <token>([^\.])com.google.protobuf</token>
+                  <value>$1${ozone.shaded.prefix}.com.google.protobuf</value>
+                </replacement>
+              </replacements>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/hadoop-ozone/ozonefs-hadoop3-client/pom.xml 
b/hadoop-ozone/ozonefs-hadoop3-client/pom.xml
deleted file mode 100644
index 50f5ccd15b3..00000000000
--- a/hadoop-ozone/ozonefs-hadoop3-client/pom.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed 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. See accompanying LICENSE file.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.apache.ozone</groupId>
-    <artifactId>ozone</artifactId>
-    <version>2.2.0-SNAPSHOT</version>
-  </parent>
-  <!--
-    This is called "ozone-filesystem-hadoop3-client" to correspond with
-    the shaded hadoop jar that it works with:
-    "hadoop-client-api.jar", (as opposed to the unshaded hadoop jar:
-    "hadoop-common.jar")
-  -->
-  <artifactId>ozone-filesystem-hadoop3-client</artifactId>
-  <version>2.2.0-SNAPSHOT</version>
-  <packaging>jar</packaging>
-  <name>Apache Ozone FS Hadoop shaded 3.x compatibility</name>
-  <properties>
-    <!-- no tests in this module so far -->
-    <maven.test.skip>true</maven.test.skip>
-    <proto.shaded.prefix>org.apache.hadoop.shaded</proto.shaded.prefix>
-  </properties>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.ozone</groupId>
-      <artifactId>ozone-filesystem-hadoop3</artifactId>
-      <optional>true</optional>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.annotation</groupId>
-          <artifactId>javax.annotation-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>javax.servlet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.hadoop.thirdparty</groupId>
-          <artifactId>${hadoop-thirdparty.protobuf.artifact}</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.slf4j</groupId>
-          <artifactId>slf4j-api</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <proc>none</proc>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <ignoredUnusedDeclaredDependencies>
-            
<ignoredUnusedDeclaredDependency>org.assertj:*</ignoredUnusedDeclaredDependency>
-            
<ignoredUnusedDeclaredDependency>org.junit.jupiter:*</ignoredUnusedDeclaredDependency>
-            
<ignoredUnusedDeclaredDependency>org.mockito:*</ignoredUnusedDeclaredDependency>
-          </ignoredUnusedDeclaredDependencies>
-        </configuration>
-        <executions>
-          <execution>
-            <id>include-dependencies</id>
-            <goals>
-              <goal>unpack</goal>
-            </goals>
-            <phase>prepare-package</phase>
-            <configuration>
-              <skip>${maven.shade.skip}</skip>
-              <excludes>META-INF/versions/**/*.*</excludes>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>org.apache.ozone</groupId>
-                  <artifactId>ozone-filesystem-shaded</artifactId>
-                  <version>${project.version}</version>
-                  <fileMappers>
-                    
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
-                      <pattern>META-INF/license/</pattern>
-                      <replacement>META-INF/licenses/</replacement>
-                    
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
-                  </fileMappers>
-                </artifactItem>
-              </artifactItems>
-              <outputDirectory>target/classes</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <phase>package</phase>
-            <configuration>
-              <skip>${maven.shade.skip}</skip>
-              <transformers>
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
-                  <resources>
-                    <resource>META-INF/BC1024KE.DSA</resource>
-                    <resource>META-INF/BC2048KE.DSA</resource>
-                    <resource>META-INF/BC1024KE.SF</resource>
-                    <resource>META-INF/BC2048KE.SF</resource>
-                  </resources>
-                </transformer>
-                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
 />
-              </transformers>
-              <relocations>
-                <relocation>
-                  <pattern>com.google.protobuf</pattern>
-                  
<shadedPattern>${proto.shaded.prefix}.com.google.protobuf</shadedPattern>
-                  <includes>
-                    <include>com.google.protobuf.*</include>
-                  </includes>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>com.github.spotbugs</groupId>
-        <artifactId>spotbugs-maven-plugin</artifactId>
-        <configuration>
-          <onlyAnalyze>org.apache.hadoop.fs.ozone.*</onlyAnalyze>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/hadoop-ozone/ozonefs-hadoop3/pom.xml 
b/hadoop-ozone/ozonefs-hadoop3/pom.xml
index f713c964f2c..a9f1af2b4ac 100644
--- a/hadoop-ozone/ozonefs-hadoop3/pom.xml
+++ b/hadoop-ozone/ozonefs-hadoop3/pom.xml
@@ -26,7 +26,6 @@
   <properties>
     <!-- no tests in this module so far -->
     <maven.test.skip>true</maven.test.skip>
-    <shaded.prefix>org.apache.hadoop.ozone.shaded</shaded.prefix>
   </properties>
   <dependencies>
     <dependency>
diff --git a/hadoop-ozone/ozonefs-shaded/pom.xml 
b/hadoop-ozone/ozonefs-shaded/pom.xml
index 5e7ec27b843..aae3dce4caf 100644
--- a/hadoop-ozone/ozonefs-shaded/pom.xml
+++ b/hadoop-ozone/ozonefs-shaded/pom.xml
@@ -28,10 +28,8 @@
     <!-- no tests in this module so far -->
     <maven.test.skip>true</maven.test.skip>
     <mdep.analyze.skip>true</mdep.analyze.skip>
-    
<ozone.shaded.native.prefix>org_apache_ozone_shaded</ozone.shaded.native.prefix>
     <!-- refer to ratis thirdparty ratis.thirdparty.shaded.native.prefix -->
     
<ratis.thirdparty.shaded.native.prefix>org_apache_ratis_thirdparty_</ratis.thirdparty.shaded.native.prefix>
-    <shaded.prefix>org.apache.ozone.shaded</shaded.prefix>
   </properties>
 
   <dependencies>
@@ -194,7 +192,7 @@
               <relocations>
                 <relocation>
                   <pattern>org</pattern>
-                  <shadedPattern>${shaded.prefix}.org</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.org</shadedPattern>
                   <excludes>
                     <exclude>org.apache.hadoop.**</exclude>
                     <exclude>org.apache.log4j.**</exclude>
@@ -214,13 +212,12 @@
                 </relocation>
                 <relocation>
                   <pattern>org.apache.ratis</pattern>
-                  
<shadedPattern>${shaded.prefix}.org.apache.ratis</shadedPattern>
+                  
<shadedPattern>${ozone.shaded.prefix}.org.apache.ratis</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>com</pattern>
-                  <shadedPattern>${shaded.prefix}.com</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.com</shadedPattern>
                   <excludes>
-                    <exclude>com.google.protobuf.**</exclude>
                     <!-- These packages are the ones that are not shaded in 
the hadoop release package.
                     To prevent conflicts, we do not include these packages in 
the ozone client release package.
                     Ozone will use hadoop / JVM to provide these dependencies. 
-->
@@ -234,43 +231,43 @@
                 </relocation>
                 <relocation>
                   <pattern>google</pattern>
-                  <shadedPattern>${shaded.prefix}.google</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.google</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>net.jcip</pattern>
-                  <shadedPattern>${shaded.prefix}.net.jcip</shadedPattern>
+                  
<shadedPattern>${ozone.shaded.prefix}.net.jcip</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>javassist</pattern>
-                  <shadedPattern>${shaded.prefix}.javassist</shadedPattern>
+                  
<shadedPattern>${ozone.shaded.prefix}.javassist</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>javax.xml.bind</pattern>
-                  
<shadedPattern>${shaded.prefix}.javax.xml.bind</shadedPattern>
+                  
<shadedPattern>${ozone.shaded.prefix}.javax.xml.bind</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>javax.activation</pattern>
-                  
<shadedPattern>${shaded.prefix}.javax.activation</shadedPattern>
+                  
<shadedPattern>${ozone.shaded.prefix}.javax.activation</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>jakarta.annotation</pattern>
-                  
<shadedPattern>${shaded.prefix}.jakarta.annotation</shadedPattern>
+                  
<shadedPattern>${ozone.shaded.prefix}.jakarta.annotation</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>kotlin</pattern>
-                  <shadedPattern>${shaded.prefix}.kotlin</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.kotlin</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>picocli</pattern>
-                  <shadedPattern>${shaded.prefix}.picocli</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.picocli</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>info</pattern>
-                  <shadedPattern>${shaded.prefix}.info</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.info</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>io</pattern>
-                  <shadedPattern>${shaded.prefix}.io</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.io</shadedPattern>
                   <excludes>
                     <exclude>io!netty!*</exclude>
                     <!-- Exclude config keys for Hadoop that look like package 
names -->
@@ -291,11 +288,11 @@
                 <!-- handling some special packages with special names -->
                 <relocation>
                   <pattern>okio</pattern>
-                  <shadedPattern>${shaded.prefix}.okio</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.okio</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>okhttp3</pattern>
-                  <shadedPattern>${shaded.prefix}.okhttp3</shadedPattern>
+                  <shadedPattern>${ozone.shaded.prefix}.okhttp3</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>
diff --git a/hadoop-ozone/pom.xml b/hadoop-ozone/pom.xml
index 32041971cbe..ac21cd77325 100644
--- a/hadoop-ozone/pom.xml
+++ b/hadoop-ozone/pom.xml
@@ -119,7 +119,6 @@
       <modules>
         <module>ozonefs-hadoop2</module>
         <module>ozonefs-hadoop3</module>
-        <module>ozonefs-hadoop3-client</module>
         <module>ozonefs-shaded</module>
       </modules>
     </profile>
diff --git a/pom.xml b/pom.xml
index 4931b700283..6a056def6b9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -157,6 +157,7 @@
     <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
     <maven-patch-plugin.version>1.3</maven-patch-plugin.version>
     
<maven-remote-resources-plugin.version>3.3.0</maven-remote-resources-plugin.version>
+    <maven-replacer-plugin.version>1.5.3</maven-replacer-plugin.version>
     <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
     <maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
     <maven-site-plugin.version>3.21.0</maven-site-plugin.version>
@@ -180,6 +181,8 @@
     <opentelemetry.version>1.56.0</opentelemetry.version>
     <os-maven-plugin.version>1.7.1</os-maven-plugin.version>
     <ozone.release>Katmai</ozone.release>
+    
<ozone.shaded.native.prefix>org_apache_ozone_shaded</ozone.shaded.native.prefix>
+    <ozone.shaded.prefix>org.apache.ozone.shaded</ozone.shaded.prefix>
     <ozone.version>2.2.0-SNAPSHOT</ozone.version>
     <!--
       4.7.6: https://github.com/remkop/picocli/issues/2309
@@ -1183,11 +1186,6 @@
         <artifactId>ozone-filesystem-hadoop3</artifactId>
         <version>${ozone.version}</version>
       </dependency>
-      <dependency>
-        <groupId>org.apache.ozone</groupId>
-        <artifactId>ozone-filesystem-hadoop3-client</artifactId>
-        <version>${ozone.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.apache.ozone</groupId>
         <artifactId>ozone-filesystem-shaded</artifactId>
@@ -1748,6 +1746,11 @@
           <artifactId>sortpom-maven-plugin</artifactId>
           <version>${sortpom-maven-plugin.version}</version>
         </plugin>
+        <plugin>
+          <groupId>com.google.code.maven-replacer-plugin</groupId>
+          <artifactId>replacer</artifactId>
+          <version>${maven-replacer-plugin.version}</version>
+        </plugin>
         <plugin>
           <groupId>com.salesforce.servicelibs</groupId>
           <artifactId>proto-backwards-compatibility</artifactId>


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

Reply via email to