Skip to content

Commit bf22314

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 bf22314

2 files changed

Lines changed: 7 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ jobs:
106106
TIKA_VERSION="${{ steps.version.outputs.tika_version }}"
107107
OUT_DIR=target/tika-grpc-docker
108108
109-
mkdir -p "${OUT_DIR}/libs" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
109+
mkdir -p "${OUT_DIR}/libs/lib" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
110110
111111
cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
112+
mvn dependency:copy-dependencies -pl tika-grpc -DoutputDirectory="${PWD}/${OUT_DIR}/libs/lib" -DincludeScope=runtime -q -B
112113
113114
# Copy tika-pipes plugin zip files
114115
for dir in tika-pipes/tika-pipes-plugins/*/; do

0 commit comments

Comments
 (0)