Skip to content

Commit 8b6dd80

Browse files
nddipiazzaCopilot
andcommitted
TIKA-4703: Fix tika-grpc Docker image missing runtime dependencies
Use 'mvn dependency:copy-dependencies' to populate the lib/ directory of runtime jars that the MANIFEST.MF Class-Path entries reference. Without this the image only contained the thin jar and Java threw: NoClassDefFoundError: io/grpc/BindableService The jar's MANIFEST.MF (set by maven-jar-plugin classpathPrefix=lib/) expects dependencies at lib/ relative to the jar, i.e. /tika/libs/lib/ in the image. Running dependency:copy-dependencies into that path after the main build ensures all runtime deps are present. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cb20b84 commit 8b6dd80

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
@@ -107,14 +107,18 @@ jobs:
107107
username: ${{ secrets.DOCKERHUB_USER }}
108108
password: ${{ secrets.DOCKERHUB_TOKEN }}
109109

110+
- name: Collect tika-grpc runtime dependencies
111+
run: mvn -pl tika-grpc dependency:copy-dependencies -DoutputDirectory=target/lib -DincludeScope=runtime -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
112+
110113
- name: Prepare tika-grpc Docker build context
111114
run: |
112115
TIKA_VERSION="${{ steps.version.outputs.tag }}"
113116
OUT_DIR=target/tika-grpc-docker
114117
115-
mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
118+
mkdir -p "${OUT_DIR}/libs/lib" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
116119
117120
cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
121+
cp tika-grpc/target/lib/*.jar "${OUT_DIR}/libs/lib/"
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
@@ -101,14 +101,18 @@ jobs:
101101
apache/tika:${{ steps.version.outputs.tika_version }}-full
102102
103103
# --- tika-grpc ---
104+
- name: Collect tika-grpc runtime dependencies
105+
run: mvn -pl tika-grpc dependency:copy-dependencies -DoutputDirectory=target/lib -DincludeScope=runtime -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
106+
104107
- name: Prepare tika-grpc Docker build context
105108
run: |
106109
TIKA_VERSION="${{ steps.version.outputs.tika_version }}"
107110
OUT_DIR=target/tika-grpc-docker
108111
109-
mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
112+
mkdir -p "${OUT_DIR}/libs/lib" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
110113
111114
cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
115+
cp tika-grpc/target/lib/*.jar "${OUT_DIR}/libs/lib/"
112116
113117
# Copy tika-pipes plugin zip files
114118
for dir in tika-pipes/tika-pipes-plugins/*/; do

0 commit comments

Comments
 (0)