gnodet-bot commented on code in PR #26526:
URL: https://github.com/apache/camel/pull/26526#discussion_r4030298547
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2251,6 +2343,27 @@ protected int runSpringBoot() throws Exception {
return p.waitFor();
}
+ /**
+ * The JVM arguments ({@code spring-boot.run.jvmArguments}) an existing
Spring Boot project is run with: logging to
+ * file, the profile, the port and properties, the flight recording and
{@code --jvm-args}.
+ */
+ List<String> buildExistingSpringBootJvmArgs() {
+ List<String> args = new ArrayList<>();
+ args.add("-Dlogging.config=classpath:logback-camel-jbang.xml");
+ if (profile != null && !"prod".equals(profile)) {
+ args.add("-Dcamel.main.profile=" + profile);
+ }
+ args.addAll(buildExistingProjectSystemProperties("server.port"));
Review Comment:
⚠️ **Propagation gap — `camel.main.name` missing for Spring Boot.**
`buildExistingQuarkusJvmArgs` and `buildExistingCamelMainSystemProperties`
both append `-Dcamel.main.name=<appName>` so the running application reports
the same name that `camel log` and the TUI use to find `<name>.log`. This
method has no `appName` parameter and omits that property entirely — `camel
log` and the TUI will fail to locate the log file for a Spring Boot project
launched with `camel run pom.xml`.
Add an `appName` parameter (mirroring `buildExistingQuarkusJvmArgs`) and
inject `-Dcamel.main.name` right after the profile block:
```suggestion
args.add("-Dcamel.main.name=" + appName);
args.addAll(buildExistingProjectSystemProperties("server.port"));
```
Update the method signature to `List<String>
buildExistingSpringBootJvmArgs(String appName)` — the caller in
`runExistingSpringBootProject` has the `model` and can call
`resolveExistingProjectAppName(projectDir, model)`.
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2251,6 +2343,27 @@ protected int runSpringBoot() throws Exception {
return p.waitFor();
}
+ /**
+ * The JVM arguments ({@code spring-boot.run.jvmArguments}) an existing
Spring Boot project is run with: logging to
+ * file, the profile, the port and properties, the flight recording and
{@code --jvm-args}.
+ */
+ List<String> buildExistingSpringBootJvmArgs() {
+ List<String> args = new ArrayList<>();
+ args.add("-Dlogging.config=classpath:logback-camel-jbang.xml");
+ if (profile != null && !"prod".equals(profile)) {
+ args.add("-Dcamel.main.profile=" + profile);
+ }
+ args.addAll(buildExistingProjectSystemProperties("server.port"));
Review Comment:
⚠️ **Propagation gap — `camel.main.name` missing for Spring Boot.**
`buildExistingQuarkusJvmArgs` and `buildExistingCamelMainSystemProperties`
both append `-Dcamel.main.name=<appName>` so the running application reports
the same name that `camel log` and the TUI use to find `<name>.log`. This
method has no `appName` parameter and omits that property entirely — `camel
log` and the TUI will fail to locate the log file for a Spring Boot project
launched with `camel run pom.xml`.
Add an `appName` parameter (mirroring `buildExistingQuarkusJvmArgs`) and
inject `-Dcamel.main.name` right after the profile block:
```suggestion
args.add("-Dcamel.main.name=" + appName);
args.addAll(buildExistingProjectSystemProperties("server.port"));
```
Update the method signature to `List<String>
buildExistingSpringBootJvmArgs(String appName)` — the caller in
`runExistingSpringBootProject` has the `model` and can call
`resolveExistingProjectAppName(projectDir, model)`.
--
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]