Claus Ibsen created CAMEL-27005:
-----------------------------------

             Summary: camel-launcher - the generate plugin installs on first 
use instead of being bundled, so the CLI download is under 100 MB
                 Key: CAMEL-27005
                 URL: https://issues.apache.org/jira/browse/CAMEL-27005
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.25.0


The Camel CLI distribution ({{camel-launcher-<version>-bin.tar.gz}}) is about 
108 MiB on main (4.23.0: 107 MiB, 4.18.0: 78 MiB). The generate plugin is the 
largest of the plugins it bundles, and could be installed on first use instead, 
as the edit plugin is. That takes the download under 100 MB.

h3. What it would save

Measured on main (after [#30126|https://github.com/apache/camel/pull/30126], 
which drops lombok and the duplicate commons-logging):
* 57 jars that only {{camel-jbang-plugin-generate}} needs, 23.8 MiB: 
{{openapi-generator}} (7.7 MB), {{guava}} (2.9), {{jna}} (1.8), 
{{woodstox-core}} (1.5), {{rhino}} (1.3), {{javaparser-core}} (1.3), 
{{caffeine}} (1.0), {{handlebars}} (0.9), {{joda-time}}, {{threetenbp}}, 
{{libphonenumber}} and others
* the tar.gz from 108.2 MiB (113.4 MB) to about 84.5 MiB (88.6 MB)

For comparison, what the other bundled plugins add beyond the core (46 MiB): 
kubernetes 21.9 MiB, test (Citrus) 17.1, tui 1.8, mcp 0.7, validate 0.7.

h3. What depends on it

Checked on main:
* only {{CamelLauncherMain}} (its list of embedded plugins) refers to the 
classes of the generate plugin; nothing in camel-jbang-core, the TUI or the MCP 
plugin does
* {{camel run --open-api}} does not use it: {{RunPipeline.generateOpenApi}} 
writes the Rest DSL file from a template
* the AI tools and the TUI do not call or suggest {{camel generate}}
* the docs already show {{camel plugin add generate}} 
({{camel-jbang-projects.adoc}})

h3. What changes for users

Only the first {{camel generate rest|code|schema}}: it downloads the plugin and 
its ~24 MiB from Maven Central, as the first {{camel edit}} does. An offline or 
air-gapped user runs {{camel plugin add generate}} while online.

A side benefit: the libraries that only openapi-generator brings (rhino, jna, 
handlebars, joda-time, ...) are no longer in every CLI install that a scanner 
looks at.

h3. To do

* remove {{camel-jbang-plugin-generate}} from the {{camel-launcher}} pom and 
from the embedded plugins of {{CamelLauncherMain}}
* {{CamelLauncherTest}} uses generate as its example of an embedded plugin: use 
another one
* test the install on first use with a launcher built from the branch (a 
SNAPSHOT resolves it from the local repository), and again with the first 
release
* upgrade guide: the generate plugin is no longer bundled with the CLI, and 
installs on first use
* the docs of the launcher that list the bundled plugins, if any

_Claude Code on behalf of Claus Ibsen (davsclaus)_




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to