Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
4e08b80
TIKA-4512 -- first steps
tballison Oct 10, 2025
5bad328
TIKA-4512 -- remove debugging class
tballison Oct 10, 2025
9287d53
Merge branch 'main' into TIKA-4512
tballison Oct 15, 2025
161f672
TIKA-4512 -- WIP do not merge
tballison Oct 17, 2025
08d9533
TIKA-4512 -- this works: mvn clean install -am -pl :tika-pipes-core-t…
tballison Oct 22, 2025
bf53b8e
TIKA-4512 -- checkpoint
tballison Oct 23, 2025
3ef978f
TIKA-4512 -- this moves testing to "on the classpath" except for tika…
tballison Oct 23, 2025
a3818e1
TIKA-4512 -- code improvements
tballison Oct 23, 2025
0929941
TIKA-4512 -- removes forking code in server
tballison Oct 23, 2025
4c93ae7
TIKA-4512 -- updates unit tests in tika-server-core for new behaviors
tballison Oct 27, 2025
2085c7e
TIKA-4512 -- updates unit tests in tika-server-standard for new behav…
tballison Oct 27, 2025
5ccb770
TIKA-4512 -- checkstyle
tballison Oct 27, 2025
c4f9b52
TIKA-4512 -- rename fetcherName to fetcherPluginId
tballison Oct 27, 2025
b06877b
TIKA-4512 -- clean up dependencies in file-system-fetcher
tballison Oct 27, 2025
d173308
Merge branch 'main' into TIKA-4519
tballison Oct 27, 2025
6eb8916
Merge branch 'main' into TIKA-4519
tballison Oct 27, 2025
18f0d77
TIKA-4519 - checkpoint
tballison Oct 29, 2025
883d936
Merge branch 'main' into TIKA-4519
tballison Nov 3, 2025
77682b9
TIKA-4519 -- checkpoint commit
tballison Nov 3, 2025
af7b252
TIKA-4519 -- tika-app tests work
tballison Nov 3, 2025
121eb7f
TIKA-4519 -- checkstyle
tballison Nov 3, 2025
57c4cf7
TIKA-4519 -- checkpoint moving into factories as plugins
tballison Nov 3, 2025
8ce960b
TIKA-4519 -- checkpoint
tballison Nov 4, 2025
d9875ca
TIKA-4519 -- checkpoint tika-pipes-tests work
tballison Nov 4, 2025
cfa57d8
TIKA-4519 -- tests through tika-app work
tballison Nov 4, 2025
05bb225
TIKA-4519 -- checkstyle through tika-app
tballison Nov 5, 2025
d73027b
TIKA-4519 -- tika-server now works
tballison Nov 5, 2025
088e08e
TIKA-4519 -- add file-system-pipes-iterator
tballison Nov 5, 2025
afd593c
TIKA-4519 -- checkpoint commit on pipesreporter
tballison Nov 6, 2025
40ba5e6
Merge branch 'main' into TIKA-4519
tballison Nov 6, 2025
e385b93
TIKA-4519 -- pipesreporter added
tballison Nov 6, 2025
b550351
TIKA-4519 -- checkstyle
tballison Nov 6, 2025
1b15799
jdbc pipes reporter and other fixes
tballison Nov 6, 2025
6ae3319
TIKA-4519 -- updates to add back includes and excludes
tballison Nov 6, 2025
a3b4cad
TIKA-4519 -- add opensearch reporter
tballison Nov 6, 2025
3255c30
TIKA-4519 -- opensearch integration tests now work
tballison Nov 7, 2025
7fc4ca4
TIKA-4519 -- checkstyle and other fixes
tballison Nov 10, 2025
0aaa7d2
TIKA-4519 -- further fixes
tballison Nov 10, 2025
d5d98b8
Merge branch 'main' into TIKA-4519
tballison Nov 10, 2025
fc4532b
Merge branch 'main' into TIKA-4519
tballison Nov 10, 2025
ed83c3f
WIP -- checkpoint. TikaPluginManager is starting to take shape.
tballison Nov 18, 2025
eeb037b
Merge branch 'main' into TIKA-4519
tballison Nov 18, 2025
8932da1
Merge branch 'main' into TIKA-4519
tballison Nov 18, 2025
dfc49a7
Add a working notes README.md
tballison Nov 19, 2025
b2f0cdc
tests in tika-app work
tballison Nov 19, 2025
3463edc
tests work in tika-server and tika-server-standard
tballison Nov 19, 2025
f9856d3
further clean up
tballison Nov 19, 2025
fa82d37
further clean up
tballison Nov 19, 2025
7ac2ce3
works through tika-app
tballison Nov 21, 2025
305019a
opensearch now works
tballison Nov 21, 2025
c43e0a4
basically builds, added in rest of pipes components
tballison Nov 21, 2025
7a8c640
solr-integration tests work
tballison Nov 21, 2025
b13f950
kafka-integration tests work
tballison Nov 21, 2025
eb1fd04
more tests work
tballison Nov 22, 2025
892ec3d
refactor to isolate jackson at plugin boundary
tballison Nov 22, 2025
66aee59
checkstyle, license headers and documentation, and a bunch of git adds
tballison Nov 22, 2025
fbd1317
checkstyle, license headers and documentation, and a bunch of git adds
tballison Nov 22, 2025
a89e118
add initial documentation
tballison Nov 22, 2025
b041ea7
formatting fixups
tballison Nov 22, 2025
618b0e1
further tweaks from manual review
tballison Nov 24, 2025
32a797a
Merge branch 'main' into TIKA-4519
tballison Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
<module>tika-bom</module>
<module>tika-core</module>
<module>tika-serialization</module>
<module>tika-plugins-core</module>
<module>tika-detectors</module>
<module>tika-parsers</module>
<module>tika-bundles</module>
<module>tika-xmp</module>
<module>tika-langdetect</module>
<module>tika-pipes</module>

<module>tika-grpc</module>
<module>tika-app</module>
<module>tika-server</module>
Expand Down
140 changes: 76 additions & 64 deletions tika-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,75 +89,16 @@
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>
false
</createDependencyReducedPom>
<artifactSet>
<excludes>
<exclude>org.apache.tika:tika-parsers-standard-package:jar:</exclude>
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/maven/plugin.xml</exclude>
<exclude>module-info.class</exclude>
<exclude>META-INF/*</exclude>
<exclude>LICENSE.txt</exclude>
<exclude>NOTICE.txt</exclude>
<exclude>CHANGES</exclude>
<exclude>README</exclude>
<exclude>builddef.lst</exclude>
<!-- https://issues.apache.org/jira/browse/TIKA-3650 -->
<exclude>javax/**/*</exclude>

</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.apache.tika.cli.TikaCLI</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/LICENSE</resource>
<file>target/classes/META-INF/LICENSE</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/NOTICE</resource>
<file>target/classes/META-INF/NOTICE</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/DEPENDENCIES</resource>
<file>target/classes/META-INF/DEPENDENCIES</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/cxf/bus-extensions.txt</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.apache.tika.cli.TikaCLI</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Automatic-Module-Name>org.apache.tika.app</Automatic-Module-Name>
</manifestEntries>
Expand All @@ -174,6 +115,77 @@
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-plugins</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/plugins</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.apache.tika</groupId>
<artifactId>tika-fetcher-file-system</artifactId>
<version>${project.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
</artifactItem>
<artifactItem>
<groupId>org.apache.tika</groupId>
<artifactId>tika-emitter-file-system</artifactId>
<version>${project.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
</artifactItem>
<artifactItem>
<groupId>org.apache.tika</groupId>
<artifactId>tika-pipes-iterator-file-system</artifactId>
<version>${project.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>runtime</includeScope>
<stripVersion>false</stripVersion>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,38 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly>
<id>standalone</id>
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 http://maven.apache.org/xsd/assembly-2.1.1.xsd">
<id>bin</id>
<formats>
<format>jar</format>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<dependencySet>
<outputDirectory></outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/README*</exclude>
<exclude>META-INF/NOTICE*</exclude>
<exclude>META-INF/LICENSE*</exclude>
<exclude>README*</exclude>
<exclude>NOTICE*</exclude>
<exclude>LICENSE*</exclude>
</excludes>
</unpackOptions>
<outputDirectory>lib</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
<excludes>
<exclude>*-sources.jar</exclude>
<exclude>*-javadoc.jar</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/plugins</directory>
<outputDirectory>plugins</outputDirectory>
</fileSet>
</fileSets>
</assembly>
2 changes: 0 additions & 2 deletions tika-app/src/main/java/org/apache/tika/cli/AsyncHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public static String[] translateArgs(String[] args) {
String c = arg.substring(TIKA_CONFIG_KEY.length());
argList.add("-c");
argList.add(c);
} else if (arg.equals("-a")) {
//do nothing
} else {
argList.add(args[i]);
}
Expand Down
5 changes: 5 additions & 0 deletions tika-app/src/main/java/org/apache/tika/cli/TikaCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ private static void async(String[] args) throws Exception {
TikaAsyncCLI.main(args);
return;
}
if (args.length == 2 && args[0].endsWith(".xml") && args[1].endsWith(".json")) {
TikaAsyncCLI.main(args);
return;
};
//TODO -- are there other shortcuts?
Path tmpConfig = null;
try {
tmpConfig = Files.createTempFile("tika-config-", ".xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class AsyncHelperTest {

@Test
public void testBasic() throws Exception {
String[] args = new String[]{"-a", "--config=blah.xml", "-i", "input.docx", "-o", "output/dir"};
String[] expected = new String[]{"-c", "blah.xml", "-i", "input.docx", "-o", "output/dir"};
String[] args = new String[]{"-a", "blah.json", "--config=blah.xml", "-i", "input.docx", "-o", "output/dir"};
String[] expected = new String[]{"-a", "blah.json", "-c", "blah.xml", "-i", "input.docx", "-o", "output/dir"};
assertArrayEquals(expected, AsyncHelper.translateArgs(args));
}
}
41 changes: 31 additions & 10 deletions tika-app/src/test/java/org/apache/tika/cli/TikaCLIAsyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TikaCLIAsyncTest {

private static final Logger LOG = LoggerFactory.getLogger(TikaCLI.class);

static final File TEST_DATA_FILE = new File("src/test/resources/test-data");

Expand All @@ -46,20 +51,33 @@ public class TikaCLIAsyncTest {
private PrintStream stderr = null;

private static Path ASYNC_CONFIG;
private static Path ASYNC_PLUGINS_CONFIG;

@TempDir
private static Path ASYNC_OUTPUT_DIR;

@BeforeAll
public static void setUpClass() throws Exception {
ASYNC_CONFIG = Files.createTempFile(ASYNC_OUTPUT_DIR, "async-config-", ".xml");
String xml = "<properties>" + "<async>" + "<numClients>3</numClients>" + "<tikaConfig>" + ASYNC_CONFIG.toAbsolutePath() + "</tikaConfig>" + "</async>" + "<fetchers>" +
"<fetcher class=\"org.apache.tika.pipes.fetcher.fs.FileSystemFetcher\">" + "<name>fsf</name>" + "<basePath>" + TEST_DATA_FILE.getAbsolutePath() +
"</basePath>" +
"</fetcher>" + "</fetchers>" + "<emitters>" + "<emitter class=\"org.apache.tika.pipes.emitter.fs.FileSystemEmitter\">" + "<name>fse</name>" + "<basePath>" +
ASYNC_OUTPUT_DIR.toAbsolutePath() + "</basePath>" + "<prettyPrint>true</prettyPrint>" + "</emitter>" + "</emitters>" +
"<pipesIterator class=\"org.apache.tika.pipes.pipesiterator.fs.FileSystemPipesIterator\">" + "<basePath>" + TEST_DATA_FILE.getAbsolutePath() + "</basePath>" +
"<fetcherName>fsf</fetcherName>" + "<emitterName>fse</emitterName>" + "</pipesIterator>" + "</properties>";
String xml = "<properties/>";
Files.write(ASYNC_CONFIG, xml.getBytes(UTF_8));
ASYNC_PLUGINS_CONFIG = Files.createTempFile(ASYNC_OUTPUT_DIR, "plugins-", ".json");

Path pluginsDir = Paths.get("target/plugins");
if (! Files.isDirectory(pluginsDir)) {
LOG.warn("CAN'T FIND PLUGINS DIR. pwd={}", Paths.get("").toAbsolutePath().toString());
}
String jsonTemplate = Files.readString(Paths.get(TikaCLIAsyncTest.class.getResource("/configs/config-template.json").toURI()),
StandardCharsets.UTF_8);

String json = jsonTemplate.replace("FETCHER_BASE_PATH", TEST_DATA_FILE.getAbsolutePath().toString())
.replace("EMITTER_BASE_PATH", ASYNC_OUTPUT_DIR.toAbsolutePath().toString())
.replace("PLUGIN_ROOTS", pluginsDir.toAbsolutePath().toString())
.replace("PLUGINS_CONFIG", ASYNC_PLUGINS_CONFIG.toAbsolutePath().toString())
.replace("TIKA_CONFIG", ASYNC_CONFIG.toAbsolutePath().toString());

;
Files.writeString(ASYNC_PLUGINS_CONFIG, json, UTF_8);
}

/**
Expand Down Expand Up @@ -103,19 +121,22 @@ private void resetContent() throws Exception {

@Test
public void testAsync() throws Exception {
String content = getParamOutContent("-a", "-c", ASYNC_CONFIG.toAbsolutePath().toString());
//extension is "jsn" to avoid conflict with json config

String content = getParamOutContent("-c", ASYNC_CONFIG.toAbsolutePath().toString(),
"-a", ASYNC_PLUGINS_CONFIG.toAbsolutePath().toString());

int json = 0;
for (File f : ASYNC_OUTPUT_DIR
.toFile()
.listFiles()) {
if (f
.getName()
.endsWith(".json")) {
.endsWith(".jsn")) {
//check one file for pretty print
if (f
.getName()
.equals("coffee.xls.json")) {
.equals("coffee.xls.jsn")) {
checkForPrettyPrint(f);
}
json++;
Expand Down
15 changes: 12 additions & 3 deletions tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ public void testMacros() throws Exception {

@Test
public void testRUnpack() throws Exception {
//TODO -- rework this to use two separate emitters
//one for bytes and one for json
String[] expectedChildren = new String[]{
"testPDFPackage.pdf.json",
//the first two test that the default single file config is working
Expand Down Expand Up @@ -396,10 +398,17 @@ private void testRecursiveUnpack(String targetFile, String[] expectedChildrenFil

private void testRecursiveUnpack(String targetFile, String[] expectedChildrenFileNames, int expectedLength) throws Exception {
Path input = Paths.get(new URI(resourcePrefix + "/" + targetFile));
String[] params = {"-Z", input.toAbsolutePath().toString(),
extractDir.toAbsolutePath().toString()};
Path pluginsDir = Paths.get("target/plugins");

String[] params = {"-Z",
"-p", ProcessUtils.escapeCommandLine(pluginsDir.toAbsolutePath().toString()),
ProcessUtils.escapeCommandLine(input.toAbsolutePath().toString()),
ProcessUtils.escapeCommandLine(extractDir
.toAbsolutePath()
.toString())};

TikaCLI.main(params);

Set<String> fileNames = getFileNames(extractDir);
String[] jsonFile = extractDir
.toFile()
Expand All @@ -408,7 +417,7 @@ private void testRecursiveUnpack(String targetFile, String[] expectedChildrenFil
assertEquals(expectedLength, jsonFile.length);

for (String expectedChildName : expectedChildrenFileNames) {
assertTrue(fileNames.contains(expectedChildName));
assertTrue(fileNames.contains(expectedChildName), expectedChildName);
}
}

Expand Down
Loading