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/orc-format.git


The following commit(s) were added to refs/heads/main by this push:
     new 7ec4156  Use protobuf-java to 3.25.1 and shade protobuf like orc
7ec4156 is described below

commit 7ec4156a948e83275afe4f7cfb498b99149ba919
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Tue Dec 5 15:25:14 2023 -0800

    Use protobuf-java to 3.25.1 and shade protobuf like orc
---
 README.md |  4 ++-
 pom.xml   | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 2b9dda1..c1b2510 100644
--- a/README.md
+++ b/README.md
@@ -51,4 +51,6 @@ Bug tracking: <a href="http://orc.apache.org/bugs";>Apache 
Jira</a>
 
 ## Building
 
-TBD
+```
+./mvnw install
+```
diff --git a/pom.xml b/pom.xml
index 0d5bb45..9895ccc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
         <dependency>
             <groupId>com.google.protobuf</groupId>
             <artifactId>protobuf-java</artifactId>
-            <version>3.22.3</version>
+            <version>3.25.1</version>
         </dependency>
     </dependencies>
 
@@ -143,6 +143,92 @@
                     <destDir>${project.artifactId}</destDir>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>${maven-shade-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>shaded-protobuf</id>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <artifactSet>
+                                <includes>
+                                    
<include>com.google.protobuf:protobuf-java</include>
+                                </includes>
+                            </artifactSet>
+                            
<shadedArtifactAttached>true</shadedArtifactAttached>
+                            
<shadedClassifierName>shaded-protobuf</shadedClassifierName>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.protobuf</pattern>
+                                    
<shadedPattern>org.apache.orc.protobuf</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>module-info.class</exclude>
+                                        <exclude>META-INF/MANIFEST.MF</exclude>
+                                        
<exclude>META-INF/DEPENDENCIES</exclude>
+                                        <exclude>META-INF/LICENSE</exclude>
+                                        <exclude>META-INF/NOTICE</exclude>
+                                        <exclude>google/protobuf/**</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>nohive</id>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <artifactSet>
+                                <includes>
+                                    
<include>com.google.protobuf:protobuf-java</include>
+                                    
<include>org.apache.hive:hive-storage-api</include>
+                                </includes>
+                            </artifactSet>
+                            
<shadedArtifactAttached>true</shadedArtifactAttached>
+                            <shadedClassifierName>nohive</shadedClassifierName>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.protobuf</pattern>
+                                    
<shadedPattern>org.apache.orc.protobuf</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.hadoop.hive</pattern>
+                                    
<shadedPattern>org.apache.orc.storage</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.hive</pattern>
+                                    
<shadedPattern>org.apache.orc.storage</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>module-info.class</exclude>
+                                        <exclude>META-INF/MANIFEST.MF</exclude>
+                                        
<exclude>META-INF/DEPENDENCIES</exclude>
+                                        <exclude>META-INF/LICENSE</exclude>
+                                        <exclude>META-INF/NOTICE</exclude>
+                                        <exclude>google/protobuf/**</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>

Reply via email to