Design Notes for Tika 4.x
This document captures the design decisions and architectural changes in Apache Tika 4.x.
Metadata Keys
Namespacing every metadata key keeps user-controlled data from overwriting values Tika itself asserts. See Metadata Changes in 4.x for the key-by-key consequences.
Fat Jars and Maven Shade Strategy
Tika 4.x moves away from fat jar/shaded artifacts. The tika-app and tika-server jars are now
thin launchers that resolve their dependencies from lib/ (and plugins from plugins/) via the
manifest Class-Path. The trade-off is that the jar is no longer self-contained: it must be run
from inside the unzipped distribution, not pulled from Maven Central on its own. See
the migration guide.
Plugins and PF4J Framework
Plugin Packaging
PF4J plugins are packaged exclusively as zips (not jars) to align with the move away from fat jars. Custom code addresses race conditions during the unzipping process across threads and processes.
Classloader Management
The team disabled PF4J’s default classpath loading to avoid complexity in unit tests. A configured plugins directory is now required.
This strict boundary prevents issues when components are loaded separately. For example, JSON
strings replace JsonNode objects to avoid problems with independent Jackson loading in plugins.
| We tried to have as few Tika dependencies in the plugins as possible. |
Serialization Architecture
Design Principles
-
Maximize Jackson usage while minimizing custom serialization code
-
Exclude Jackson from
tika-coreandtika-parsers-standard-modulesdependencies -
Enable runtime configuration updates via Jackson’s
readerForUpdating
Security Model
Trusted config files at initialization, a registry-restricted instantiation path, and a fail-closed allowlist for anything arriving on the wire. See Serialization: security model for the rules and their boundary.
Annotations System
The @TikaComponent annotation handles:
-
Automatic service file generation at build time
-
Creation of
META-INF/tika/*.idxmapping files -
Kebab-case conversion of class names to friendly identifiers (e.g.,
PDFParser→pdf-parser) -
Manual name overrides via
nameattribute -
Optional
spi=falsesetting for non-service-file registration
Development Tips
Outstanding Tasks
-
Implement flexible component loading without
@TikaComponentrequirements -
Enable friendly name usage throughout the codebase
-
Fix external renderer byte-passing in open containers
-
Simplify and strengthen serialization code
-
Complete the
tika-appconfig-dump CLI integration (Not Yet in 4.x)