Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ public abstract class ExportBaseCommand extends CamelCommand {
defaultValue = "CamelApplication")
protected String mainClassname = "CamelApplication";

@CommandLine.Option(names = { "--java-version" }, completionCandidates = JavaVersionCompletionCandidates.class,
@CommandLine.Option(names = {
"--java-version",
"--java" }, completionCandidates = JavaVersionCompletionCandidates.class,
description = "Java version (${COMPLETION-CANDIDATES})", defaultValue = "21")
protected String javaVersion = "21";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ public class Run extends CamelCommand {
@Option(names = { "--empty" }, defaultValue = "false", description = "Run an empty Camel without loading source files")
public boolean empty;

@CommandLine.Option(names = { "--java-version" }, completionCandidates = JavaVersionCompletionCandidates.class,
@CommandLine.Option(names = {
"--java-version",
"--java" }, completionCandidates = JavaVersionCompletionCandidates.class,
description = "Java version (${COMPLETION-CANDIDATES})", defaultValue = "21")
protected String javaVersion = "21";

Expand Down Expand Up @@ -1490,7 +1492,10 @@ protected int runCamelVersion(KameletMain main) throws Exception {
}

if (javaVersion != null) {
jbangArgs.add("--java-version=" + javaVersion);
jbangArgs.add("--java=" + javaVersion);
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.

should we change the --java-version parameter too which was added in the breaking commit in order to keep consistency between commands? c00319b

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, in this case, --java is the JBang one, but I guess I can add an alias (for backward compatibility) to the Camel JBang Run and Export, wdyt?

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.

I think it should work but worth to be tried, including when using "cross-versions" of Camel and Camel Jbang (which can be potentially used in from command-line and from VS Code integrations) because it reminds me simlar issues than afb0b1a when there was a renaming of property

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, I just pushed a new commit that handle cross-version compatibility.. I actually never thought about cross-versions compatibility... well.. it is scary :D but I do think that most of the user stick on the latest Camel JBang version

// remove from cmds so it is not passed to the older Camel version
// which may not recognize the --java alias
cmds.removeIf(arg -> arg.startsWith("--java-version") || arg.startsWith("--java="));
}
if (repositories != null) {
jbangArgs.add("--repos=" + repositories);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ appender.stdout.layout.type = PatternLayout
# logging style that is similar to spring boot (no color)
appender.stdout.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} %5p %pid --- [%15.15t] %-35.35c : %m%n

# file logger
appender.file.type = File
appender.file.name = file
appender.file.fileName = ${sys:user.home}${sys:file.separator}.camel${sys:file.separator}${sys:pid}.log
appender.file.createOnDemand = true
appender.file.append = false
appender.file.layout.type = PatternLayout
# logging style that is similar to spring boot (no color)
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} %5p %pid --- [%15.15t] %-35.35c : %m%n

# log to console and file
rootLogger = INFO,out,file
rootLogger.level = INFO
rootLogger.appenderRef.out.ref = out

Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public class KubernetesRun extends KubernetesBaseCommand {
description = "Whether downloading JARs from ASF Maven Snapshot repository is enabled")
boolean mavenApacheSnapshotEnabled = true;

@CommandLine.Option(names = { "--java-version" }, description = "Java version", defaultValue = "21")
@CommandLine.Option(names = { "--java-version", "--java" }, description = "Java version", defaultValue = "21")
String javaVersion = "21";

@CommandLine.Option(names = { "--camel-version" },
Expand Down
Loading