Repository navigation
SOLR-18517: Port RunExampleTool to picocli - #5050
Merged
janhoy merged 7 commits intoOct 8, 2026
Merged
Conversation
Adds the picocli code path next to the commons-cli one, so that bin/solr start -e works with the picocli parser, with a test twin. The command is called only by the bin/solr scripts, so it is hidden from the generated reference.
janhoy
requested changes
Oct 7, 2026
janhoy
left a comment
Contributor
There was a problem hiding this comment.
The generic changelog comment, and a behavior diff from commons-cli
No picocli feature has been released yet, so a new command is a detail of the SOLR-17697 entry. Its author and JIRA are added there instead of a separate entry.
…run_example bin/solr passes -Dname=value arguments on to run_example. commons-cli takes them out before parsing (SolrCLI.parseCmdLine) and hands them on as extra arguments, but picocli rejected the first one as an unknown option. They are now collected as unmatched options and kept as extra arguments after the positional ones; any other unknown option still ends in picocli's usage error, exit code 2.
…ts test sets AGENTS.md says the base classes restore system properties after each test, so the try/finally with clearProperty is dropped; the check that the port defaults to 8983 without the property becomes a test of its own.
janhoy
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-18517
Description
Adds the picocli code path for
run_example, whichbin/solr start -ecalls, next to the commons-cli one.Solution
RunExampleToolgets its annotated options andcallTool()and is registered inSolrCLI; the commons-cli path is unchanged. The options are the ones thebin/solrscripts pass, including--script-inputs. The command is only invoked by the scripts, so it is hidden and has no reference page. Written with Claude Code.Tests
SolrCLIRunExamplePicocliTestruns the existingTestSolrCLIRunExamplethrough picocli, and checks that the port and--zk-hostdefaults come from the properties. WithSOLR_PICOCLI=true,bin/solr start -e techproductsstarts and indexes the example.check -x testis clean (rat skipped).Checklist
mainbranch../gradlew check.