From 0d1630f02270dc7cdce9e6eab396c065d2d3adc5 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Tue, 6 Dec 2022 10:14:33 -0800 Subject: [PATCH] ORC-1333: Exclude the proto files from the nohive jar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Why are the changes needed? We're seeing some conflicts in the proto files when updating Iceberg in Trino: https://github.com/trinodb/trino/pull/15079#discussion_r1025121839 I think we should exclude the proto files from the `nohive` jar. Before the change: ``` ➜ java git:(main) ✗ rm -rf core/target/ ➜ java git:(main) ✗ mvn package -DskipTests ➜ java git:(main) ✗ cd core/target ➜ target git:(main) ✗ unzip orc-core-1.9.0-SNAPSHOT-nohive.jar ➜ target git:(main) find . | grep -i "google/protobuf/" ./google/protobuf/timestamp.proto ./google/protobuf/field_mask.proto ./google/protobuf/api.proto ./google/protobuf/duration.proto ./google/protobuf/struct.proto ./google/protobuf/wrappers.proto ./google/protobuf/source_context.proto ./google/protobuf/any.proto ./google/protobuf/type.proto ./google/protobuf/empty.proto ./google/protobuf/compiler ./google/protobuf/compiler/plugin.proto ./google/protobuf/descriptor.proto ``` After the change: ``` ➜ java git:(main) ✗ rm -rf core/target/ ➜ java git:(main) ✗ mvn package -DskipTests ➜ java git:(main) ✗ cd core/target ➜ target git:(main) ✗ unzip orc-core-1.9.0-SNAPSHOT-nohive.jar ➜ target git:(main) ✗ find . | grep -i "google/protobuf/" ∅ ``` Interestingly enough, the normal jar doesn't contain these proto files: ``` ➜ java git:(main) ✗ rm -rf core/target/ ➜ java git:(main) ✗ mvn package -DskipTests ➜ java git:(main) ✗ cd core/target ➜ target git:(main) unzip orc-core-1.9.0-SNAPSHOT.jar| grep -i proto ➜ target git:(main) find . | grep -i "google/protobuf/" ∅ ``` ### What changes were proposed in this pull request? Exclude the proto files ### How was this patch tested? Inspecting the produced jar Closes https://github.com/apache/orc/issues/1333 Closes #1334 from Fokko/fd-exclude-proto-files. Authored-by: Fokko Driesprong Signed-off-by: Dongjoon Hyun --- java/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/java/pom.xml b/java/pom.xml index 8b7b95e577..7db33c8917 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -506,6 +506,7 @@ META-INF/DEPENDENCIES META-INF/LICENSE META-INF/NOTICE + google/protobuf/**