Skip to content

chore: camel-launcher - the CLI distribution no longer ships lombok, nor commons-logging next to jcl-over-slf4j - #30126

Merged
davsclaus merged 1 commit into
mainfrom
chore-launcher-no-lombok
Nov 15, 2026
Merged

davsclaus merged 1 commit into
mainfrom
chore-launcher-no-lombok

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

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

…nor commons-logging next to jcl-over-slf4j

lombok (2 MB) came with openapi-generator, whose pom has it in the
compile scope. Its classes only refer to @lombok.Generated, which has
CLASS retention, so nothing loads lombok at runtime.

commons-logging (1.2 from httpclient, 1.3.5 from spring-core) has the
same org.apache.commons.logging classes as jcl-over-slf4j, which the
launcher declares, so the first of the two on the class path won.
Now there is only jcl-over-slf4j.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus davsclaus added this to the 4.24.0 milestone Nov 15, 2026
@davsclaus davsclaus added the dsl label Nov 15, 2026
@davsclaus davsclaus self-assigned this Nov 15, 2026
@github-actions

Copy link
Copy Markdown
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 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.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The exclusions are correct and the rationale is well-documented.

  • lombok: Correctly excluded from camel-jbang-plugin-generate where openapi-generator pulls it in with compile scope. The 158 @lombok.Generated references all have CLASS retention — the JVM never loads lombok at runtime. The exclusion also applies when the plugin is loaded via JBang. ✅
  • commons-logging from httpclient and from camel-jbang-core (spring-core transitive): Both are correct targets. jcl-over-slf4j already in the launcher provides the same org.apache.commons.logging classes and routes to SLF4J. Having both on the classpath is a clash, not a redundancy — removing the duplicates is the right fix. ✅

Pre-fix validation: POM-only change — no behavioral code path to validate dynamically. The PR body lists manual verification: camel generate rest, camel run, and the relevant test suites (12 plugin-generate tests + launcher tests) all pass.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-plugin-generate
  • dsl/camel-jbang/camel-launcher

🔬 Scalpel shadow comparison — Scalpel: 1 of 726 tested, 0 compile-only — current: 1 all tested

Maveniverse Scalpel detected 1 affected modules (current approach: 1).

Skip-tests mode would test 1 modules (2 direct + 0 downstream), skip tests for 0 (generated code, meta-modules)

Modules Scalpel would test (1)
  • camel-launcher-container ← depends on affected reactor module org.apache.camel:camel-launcher

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-plugin-generate, dsl/camel-jbang/camel-launcher. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (4 modules, 1m 12s total)

Total reactor time: 1m 12s

Module Duration Status
Camel :: Launcher 58.4s SUCCESS
Camel :: JBang :: Plugin :: Generate 9.6s SUCCESS
Camel :: Coverage 3.8s SUCCESS
Camel :: Launcher :: Container 0.7s SUCCESS

Top 20 slowest modules:

  • Camel :: Launcher (58.4s)
  • Camel :: JBang :: Plugin :: Generate (9.6s)
  • Camel :: Coverage (3.8s)
  • Camel :: Launcher :: Container (0.7s)

⚙️ View full build and test results

@davsclaus davsclaus added the task label Nov 15, 2026
@davsclaus
davsclaus merged commit e20f87f into main Nov 15, 2026
13 checks passed
@davsclaus
davsclaus deleted the chore-launcher-no-lombok branch November 15, 2026 22:06
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.

2 participants