Skip to content

TIKA-4734 - #2843

Merged
tballison merged 4 commits into
mainfrom
TIKA-4734
May 28, 2026
Merged

TIKA-4734#2843
tballison merged 4 commits into
mainfrom
TIKA-4734

Conversation

@tballison

Copy link
Copy Markdown
Contributor

Thanks for your contribution to Apache Tika! Your help is appreciated!

Before opening the pull request, please verify that

  • there is an open issue on the Tika issue tracker which describes the problem or the improvement. We cannot accept pull requests without an issue because the change wouldn't be listed in the release notes.
  • the issue ID (TIKA-XXXX)
    • is referenced in the title of the pull request
    • and placed in front of your commit messages surrounded by square brackets ([TIKA-XXXX] Issue or pull request title)
  • commits are squashed into a single one (or few commits for larger changes)
  • Tika is successfully built and unit tests pass by running ./mvnw clean test
  • there should be no conflicts when merging the pull request branch into the recent main branch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulled main branch
  • if you add new module that downstream users will depend upon add it to relevant group in tika-bom/pom.xml.

We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes TIKA-4734 by ensuring --convert-config-xml-to-json is treated as a standalone CLI utility (not routed into Tika Pipes/async mode) and by changing the conversion output behavior to write JSON to stdout for shell redirection.

Changes:

  • Prevent async-mode auto-detection from triggering when --convert-config-xml-to-json=... is present.
  • Change --convert-config-xml-to-json to accept only an input XML path and emit the converted JSON to stdout (with updated CLI help text).
  • Add a CLI regression test and update the 4.x migration docs to reflect the new invocation pattern.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java Adds a regression test asserting that XML→JSON conversion runs standalone and prints JSON to stdout.
tika-app/src/main/java/org/apache/tika/cli/TikaCLI.java Adjusts async detection and updates the conversion implementation and CLI usage text for stdout output.
docs/modules/ROOT/pages/migration-to-4x/migrating-to-4x.adoc Updates migration guide example to use stdout redirection and notes no separate --config is required.
Comments suppressed due to low confidence (1)

tika-app/src/main/java/org/apache/tika/cli/TikaCLI.java:408

  • In testForAsync(), the heuristic args.length == 1 && args[0].endsWith(".json") will also match option arguments like --config=...json, which should be handled by the normal CLI (process() parses --config=) rather than routing into async mode. Consider tightening this check (e.g., require the arg not to start with '-' / be a real path) to avoid misclassifying single-option invocations.
        // Single .json file is a config file for async mode
        if (args.length == 1 && args[0].endsWith(".json")) {
            return true;
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tika-app/src/main/java/org/apache/tika/cli/TikaCLI.java
Comment thread tika-app/src/main/java/org/apache/tika/cli/TikaCLI.java Outdated
Comment thread tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@tballison
tballison merged commit 2bab6d4 into main May 28, 2026
6 checks passed
@tballison
tballison deleted the TIKA-4734 branch May 28, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants