davsclaus opened a new pull request, #29342: URL: https://github.com/apache/camel/pull/29342
_Claude Code on behalf of Claus Ibsen_ [CAMEL-26694](https://issues.apache.org/jira/browse/CAMEL-26694), stages 1 and 2 of removing Roaster. ### Stage 1: camel-report-maven-plugin It declared `roaster-api` and `roaster-jdt`, but no code of it uses them. It reads Java routes with `LwJavaParser` (camel-java-io), and from camel-route-parser it uses only `XmlRouteParser` and the model classes. The dependencies are removed. Roaster still comes in through camel-route-parser until stage 3. ### Stage 2: PrepareCamelJBangMojo reads the compiled class The goal used Roaster to parse the `*Constants.java` sources of camel-jbang-run for their `@Metadata` fields. Now it loads the compiled class from the project's class loader (camel-jbang-run is a dependency of camel-jbang-core) and reads the annotations by reflection. `@Metadata` has runtime retention, and other goals of this plugin already read it this way. The compiler has already joined a description written as `"..." + "..."`. That fixes, at the root, the `+` that the `camel.jbang.dataDir` description has on main ("…read or write, + not sources…"). - The regenerated metadata (camel-jbang-core, the catalog copy, `camel-jbang-configuration.adoc`) changes in one line only: `dataDir`. The other 53 options come out exactly as Roaster gave them. - `DstWorldsHelper` stays on Roaster. The `@DstWorld` classes are test classes, which are not compiled when the component JSON is generated (and never with `-Dmaven.test.skip`), so it must read sources. It moves to stage 4 (the JDK's own parser); the JIRA is updated. This replaces the quick fix #29341, which fixed the same `+` by joining the literals in the Roaster path. If this PR goes in, #29341 can be closed. ### Tests - New `PrepareCamelJBangMojoTest`: - the options of a compiled configuration class: a joined description, the default value, the label, the security secret, a deprecated option with enums, and a field without `@Metadata` left out; - the class name of a source file. - `PrepareCamelJBangCommandsMojoTest` and `PrepareCamelMainMojoTest` pass. - camel-report-maven-plugin: 70 tests pass without the Roaster dependency. - End to end: the plugin, camel-jbang-run and camel-jbang-core built in one reactor into a scratch local repo (not `~/.m2`). The goal logged `Reading Camel CLI configuration class: org.apache.camel.dsl.jbang.run.common.CamelJBangConstants`, and the regenerated files are in this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
