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

nddipiazza pushed a commit to branch TIKA-4703-fix-grpc-missing-lib-deps
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 799b436efcfbf9deeabd7bc3a5c61c9b33af016a
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Mon Apr 27 08:48:16 2026 -0500

    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 <[email protected]>
---
 .github/workflows/docker-release.yml  | 6 +++++-
 .github/workflows/docker-snapshot.yml | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/docker-release.yml 
b/.github/workflows/docker-release.yml
index d6e6971dfd..25129b5dfb 100644
--- a/.github/workflows/docker-release.yml
+++ b/.github/workflows/docker-release.yml
@@ -114,7 +114,11 @@ jobs:
 
           mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" 
"${OUT_DIR}/bin"
 
-          cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" 
"${OUT_DIR}/libs/"
+          # The assembly zip contains the jar + lib/ (runtime deps referenced 
by MANIFEST.MF Class-Path)
+          unzip -q "tika-grpc/target/tika-grpc-${TIKA_VERSION}.zip" -d 
"${OUT_DIR}/libs_tmp"
+          cp "${OUT_DIR}/libs_tmp/tika-grpc-${TIKA_VERSION}.jar" 
"${OUT_DIR}/libs/"
+          cp -r "${OUT_DIR}/libs_tmp/lib" "${OUT_DIR}/libs/lib"
+          rm -rf "${OUT_DIR}/libs_tmp"
 
           # Copy tika-pipes plugin zip files
           for dir in tika-pipes/tika-pipes-plugins/*/; do
diff --git a/.github/workflows/docker-snapshot.yml 
b/.github/workflows/docker-snapshot.yml
index 5b4e041415..cc5a453df7 100644
--- a/.github/workflows/docker-snapshot.yml
+++ b/.github/workflows/docker-snapshot.yml
@@ -108,7 +108,11 @@ jobs:
 
           mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" 
"${OUT_DIR}/bin"
 
-          cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" 
"${OUT_DIR}/libs/"
+          # The assembly zip contains the jar + lib/ (runtime deps referenced 
by MANIFEST.MF Class-Path)
+          unzip -q "tika-grpc/target/tika-grpc-${TIKA_VERSION}.zip" -d 
"${OUT_DIR}/libs_tmp"
+          cp "${OUT_DIR}/libs_tmp/tika-grpc-${TIKA_VERSION}.jar" 
"${OUT_DIR}/libs/"
+          cp -r "${OUT_DIR}/libs_tmp/lib" "${OUT_DIR}/libs/lib"
+          rm -rf "${OUT_DIR}/libs_tmp"
 
           # Copy tika-pipes plugin zip files
           for dir in tika-pipes/tika-pipes-plugins/*/; do

Reply via email to