Skip to content

Commit 799b436

Browse files
nddipiazzaCopilot
andcommitted
TIKA-4703: Fix tika-grpc Docker image missing runtime dependencies
The docker build context only copied the thin jar (tika-grpc-X.jar) but not the lib/ directory containing all runtime dependencies. The jar's MANIFEST.MF Class-Path references lib/*.jar relative to the jar location, so without that directory Java throws: NoClassDefFoundError: io/grpc/BindableService Fix: unzip the Maven assembly zip (which bundles the jar + lib/) and copy both into the build context. The Dockerfile COPY libs/ -> /tika/libs/ then places them at: /tika/libs/tika-grpc-X.jar (the main jar) /tika/libs/lib/*.jar (runtime deps, per MANIFEST Class-Path) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cb20b84 commit 799b436

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/docker-release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ jobs:
114114
115115
mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
116116
117-
cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
117+
# The assembly zip contains the jar + lib/ (runtime deps referenced by MANIFEST.MF Class-Path)
118+
unzip -q "tika-grpc/target/tika-grpc-${TIKA_VERSION}.zip" -d "${OUT_DIR}/libs_tmp"
119+
cp "${OUT_DIR}/libs_tmp/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
120+
cp -r "${OUT_DIR}/libs_tmp/lib" "${OUT_DIR}/libs/lib"
121+
rm -rf "${OUT_DIR}/libs_tmp"
118122
119123
# Copy tika-pipes plugin zip files
120124
for dir in tika-pipes/tika-pipes-plugins/*/; do

.github/workflows/docker-snapshot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ jobs:
108108
109109
mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
110110
111-
cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
111+
# The assembly zip contains the jar + lib/ (runtime deps referenced by MANIFEST.MF Class-Path)
112+
unzip -q "tika-grpc/target/tika-grpc-${TIKA_VERSION}.zip" -d "${OUT_DIR}/libs_tmp"
113+
cp "${OUT_DIR}/libs_tmp/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
114+
cp -r "${OUT_DIR}/libs_tmp/lib" "${OUT_DIR}/libs/lib"
115+
rm -rf "${OUT_DIR}/libs_tmp"
112116
113117
# Copy tika-pipes plugin zip files
114118
for dir in tika-pipes/tika-pipes-plugins/*/; do

0 commit comments

Comments
 (0)