Skip to content

Fix JBang metadata generation to detect all commands#22221

Open
gnodet wants to merge 4 commits intomainfrom
fix-jbang-metadata-mojo
Open

Fix JBang metadata generation to detect all commands#22221
gnodet wants to merge 4 commits intomainfrom
fix-jbang-metadata-mojo

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 24, 2026

Summary

  • Fix PrepareCamelJBangCommandsMojo to match new CommandLine(this) in addition to new CommandLine(main), and update the subcommand regex accordingly
  • This was causing several commands/options to be missing from generated docs and metadata:
    • Missing wrapper command and dataweave subcommand docs
    • Missing bind deprecation notice
    • Wrong description for --skip-plugins option
  • Regenerated all affected docs and metadata

Test plan

  • Build succeeds with mvn install -B -pl tooling/maven/camel-package-maven-plugin,dsl/camel-jbang/camel-jbang-core -DskipTests
  • CI passes

The PrepareCamelJBangCommandsMojo was not discovering all commands because:
- It searched for `new CommandLine(main)` but CamelJBangMain uses `new CommandLine(this)`
- The SUBCOMMAND_PATTERN regex only matched `(main)` constructor arg, not `(this)`

This caused several commands and options to be missing from generated docs:
- Missing `wrapper` command, `dataweave` subcommand
- Missing `bind` deprecation notice
- Wrong description for `--skip-plugins` option

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

🧪 CI tested the following changed modules:

  • docs
  • dsl/camel-jbang/camel-jbang-core
  • tooling/maven/camel-package-maven-plugin

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

Build reactor — dependencies compiled but only changed modules were tested (6 modules)
  • Camel :: Docs
  • Camel :: Docs [pom]
  • Camel :: JBang :: Core
  • Camel :: JBang :: Core [jar]
  • Camel :: Maven Plugins :: Camel Maven Package
  • Camel :: Maven Plugins :: Camel Maven Package [maven-plugin]

The gulp glob pattern dsl/**/src/main/docs/*.adoc scans recursively
through the dsl/ tree, racing with camel-jbang-core tests that
create/delete .camel-jbang/work directories. Add .camel-jbang to the
ignore list alongside target to prevent ENOENT errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the fix-jbang-metadata-mojo branch from c599fd5 to c0f74cd Compare March 24, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant