davsclaus opened a new pull request, #30126: URL: https://github.com/apache/camel/pull/30126
## What The Camel CLI distribution (`camel-launcher`, about 107 MiB for 4.23.0) shipped two jars it doesn't need: - **`lombok-1.18.38.jar` (2 MB)**: brought in by `camel-jbang-plugin-generate` → `openapi-generator` 7.26.0, whose pom declares Lombok with no scope, so it counts as a compile dependency. All 158 Lombok references in openapi-generator's classes are `@lombok.Generated`, which has `CLASS` retention: the JVM never loads it. The exclusion goes in `camel-jbang-plugin-generate`, so it also applies when the plugin is downloaded through JBang. - **`commons-logging`**: 1.2 came from `httpclient`, and once that path is excluded, 1.3.5 from `spring-core` 7. It contains the same `org.apache.commons.logging` classes as `jcl-over-slf4j`, which the launcher declares itself, so whichever came first on the manifest Class-Path won (commons-logging, at position 322 against 325). Now only `jcl-over-slf4j` is left, and JCL always goes to SLF4J. The distribution goes from 344 to 342 jars, and the tar.gz from 110.0 to 108.2 MiB. I also checked these, and they stay: - `slf4j-ext`: openapi-generator's `OnceLogger` extends `org.slf4j.ext.LoggerWrapper`, and `DefaultCodegen` uses it. - JUnit 4 and hamcrest: `citrus-junit` registers the Citrus `junit4` engine (`META-INF/citrus/engine/junit4`). - Jackson 2 and 3: different libraries need them. - The Swagger 2 parser stack: openapi-generator uses it to convert Swagger 2.0 specs. - `javapoet`: the Rest DSL generator uses it. - The small annotation jars (`jsr305`, `error_prone_annotations`, `j2objc-annotations`): together under 60 KB. Most of the size is in the bundled plugins (core about 46 MiB, then roughly `generate` 25, `kubernetes` 24, `test` 19 MiB). That's a question of which plugins ship in the box, not for this PR. ## Tests With a launcher built from this branch, compared with one built from main (in a separate home): - `camel generate rest --input=petstore.yaml --dto` writes the same files (apart from the timestamp in `@Generated`) and the same console output. - `camel run` of a route with `--dep` of a jar that isn't in the local repository downloads it, runs the route, and logs httpclient's DEBUG through the Camel logging, as before. - `camel-jbang-plugin-generate` tests (12) and the `CamelLauncherTest`, `CamelLauncherMainEmbeddedPluginsTest` and `LauncherStartupLoggingTest` launcher tests pass. _Claude Code on behalf of Claus Ibsen (davsclaus)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
