davsclaus commented on PR #30559: URL: https://github.com/apache/camel/pull/30559#issuecomment-7069311144
Thanks for working on this. Being able to deploy to Tomcat is a good addition. I have a design suggestion before this goes further. Tomcat is not really a runtime here: the generated project is a Spring Boot application packaged as a WAR, and the Tomcat version (10.1 or 11) is already derived from the Spring Boot version. Would it fit better as a `--packaging` option on the Spring Boot runtime? ```bash camel export foo.java --runtime=spring-boot --packaging=war camel run foo.java --runtime=spring-boot --packaging=war # spring-boot:run, embedded Tomcat camel kubernetes export foo.java --runtime=spring-boot --packaging=war # Tomcat base image + ROOT.war ``` - The values would be `jar` (the default) and `war`, the same words as Maven's `<packaging>`. - `--packaging=war` with `--runtime=main` or `--runtime=quarkus` fails with a clear error. What this would save: - `RuntimeType` stays as it is. With a `tomcat` runtime, it has to be special-cased in places that have nothing to do with packaging: the run and export type converters, the new `ExportRuntimeCompletionCandidates`, the `RunPipeline` dependencies, the MCP `CatalogService` and `VersionTools`, and the version handling in `RuntimeType`. - `camel run` works too, without a new runner. `SpringBootRunner` exports the project and runs `spring-boot:run`, which puts the `provided` `spring-boot-starter-tomcat` on the classpath, so the app runs on embedded Tomcat from the same project you deploy as a WAR. Today the PR rejects `camel run --runtime=tomcat`. - The checks you added stay the same, keyed on `packaging == war` instead of `runtime == tomcat`: Spring Boot 3.x/4.x only, no custom POM templates, no Docker or Jib files, and the `docker` or `jib` image builder only on Kubernetes. The templates keep working, with `[#if Tomcat]` becoming `[#if War]`. Users looking for "tomcat" would find it in a "Deploying to an external Tomcat" section in `camel-jbang-projects.adoc` that shows `--packaging=war`. What do you think? _Claude Code on behalf of davsclaus_ -- 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]
