You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/10/17 08:09:00 UTC
[jira] [Resolved] (CAMEL-25717) camel-jbang - The docs of camel test init list the options of camel init
[ https://issues.apache.org/jira/browse/CAMEL-25717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-25717.
---------------------------------
Resolution: Fixed
Merged https://github.com/apache/camel/pull/27997 (55ed20f14e90, 4.24.0): the page of camel test init lists --directory and -h,--help, the options of the Init of Citrus. A parent class or mixin type that a command class imports by name is only taken from a source of that type, or else read from the classpath of the project.
_Claude Code on behalf of davsclaus_
> camel-jbang - The docs of camel test init list the options of camel init
> ------------------------------------------------------------------------
>
> Key: CAMEL-25717
> URL: https://issues.apache.org/jira/browse/CAMEL-25717
> Project: Camel
> Issue Type: Bug
> Components: camel-jbang, tooling
> Affects Versions: 4.23.0
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> The generated page of {{camel test init}} ([camel-jbang-test-init.adoc|https://github.com/apache/camel/blob/main/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-test-init.adoc], and the {{camel-jbang-plugin-commands-metadata.json}} of camel-jbang-plugin-test) lists the options of {{camel init}}: {{--clean-dir}}, {{--dir}}, {{--force}}, {{--from-kamelet}}, {{--kamelets-version}}, {{--list}}, {{--pipe}} and {{--repo}}. {{camel test init}} has none of them: {{TestInit}} extends {{org.citrusframework.jbang.cli.commands.Init}} of Citrus, whose options in Citrus 5.0.2 are the {{<file>}} parameter, {{--directory}} (default {{.}}) and {{-h,--help}}. The page has been wrong since it was added in 4.23.0 (https://github.com/apache/camel/pull/27301).
> *Cause:* {{PrepareCamelJBangCommandsMojo.parseOptionsFromClassHierarchy}} (camel-package-maven-plugin) drops the package of the superclass, and {{findClassFile}} looks for its source by simple name. The Citrus {{Init}} is not in the source tree, so the fallback for a plugin command that extends a command of camel-jbang-core ({{coreCommandsDir}}) finds the {{Init.java}} of camel-jbang-core and documents its options. A plugin command whose superclass from a library has the simple name of a core command would be documented the same way.
> *Fix:* only take a source file whose class is the superclass (same package, or the qualified name from the imports), for example by comparing the qualified name of the parsed class with the super type; otherwise document no inherited options, or read them from the class with picocli, as there is no source to parse. Then regenerate the page and the metadata.
> Found in https://github.com/apache/camel/pull/27995 ({{camel init --force}}), where the regenerated page of {{camel test init}} got {{--force}} too.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)