Skip to content

Commit

Permalink
ORC-1327: Exclude the proto files from the nohive jar
Browse files Browse the repository at this point in the history
We're seeing some conflicts in the proto files when updating Iceberg in Trino: trinodb/trino#15079 (comment)

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/"
∅
```

Exclude the proto files

Inspecting the produced jar

Closes apache#1333

Closes apache#1334 from Fokko/fd-exclude-proto-files.

Authored-by: Fokko Driesprong <fokko@tabular.io>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit f6fee07)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
  • Loading branch information
Fokko authored and cxzl25 committed Jan 11, 2024
1 parent 01fd12c commit 263d41e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@
<exclude>META-INF/DEPENDENCIES</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>google/protobuf/**</exclude>
</excludes>
</filter>
</filters>
Expand Down

0 comments on commit 263d41e

Please sign in to comment.