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 @@ -377,6 +377,7 @@ protected Integer runSilently(boolean ignoreLoadingError, boolean lazyBean, bool
run.quarkusGroupId = quarkusGroupId;
run.springBootVersion = springBootVersion;
run.kameletsVersion = kameletsVersion;
run.javaVersion = javaVersion;
run.localKameletDir = localKameletDir;
run.ignoreLoadingError = ignoreLoadingError;
run.lazyBean = lazyBean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,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" }, description = "Java version", defaultValue = "21")
protected String javaVersion = "21";

@Option(names = { "--camel-version" }, description = "To run using a different Camel version than the default version.")
String camelVersion;

Expand Down Expand Up @@ -649,6 +652,7 @@ private int run() throws Exception {
writeSetting(main, profileProperties, QUARKUS_VERSION, quarkusVersion);
writeSetting(main, profileProperties, QUARKUS_GROUP_ID, quarkusGroupId);
writeSetting(main, profileProperties, QUARKUS_ARTIFACT_ID, quarkusArtifactId);
writeSetting(main, profileProperties, JAVA_VERSION, javaVersion);

if (observe) {
main.addInitialProperty(DEPENDENCIES, "camel:observability-services");
Expand Down Expand Up @@ -1065,6 +1069,7 @@ protected int runQuarkus() throws Exception {
eq.quarkusGroupId = this.quarkusGroupId;
eq.quarkusArtifactId = this.quarkusArtifactId;
eq.camelVersion = this.camelVersion;
eq.javaVersion = this.javaVersion;
eq.kameletsVersion = this.kameletsVersion;
eq.exportDir = runDirPath.toString();
eq.localKameletDir = this.localKameletDir;
Expand Down Expand Up @@ -1350,6 +1355,7 @@ private Properties doLoadAndInitProfileProperties(Path profilePropertiesPath) th
camelVersion = answer.getProperty(CAMEL_VERSION, camelVersion);
kameletsVersion = answer.getProperty(KAMELETS_VERSION, kameletsVersion);
springBootVersion = answer.getProperty(SPRING_BOOT_VERSION, springBootVersion);
javaVersion = answer.getProperty(JAVA_VERSION, javaVersion);
quarkusGroupId = answer.getProperty(QUARKUS_GROUP_ID, quarkusGroupId);
quarkusArtifactId = answer.getProperty(QUARKUS_ARTIFACT_ID, quarkusArtifactId);
quarkusVersion = answer.getProperty(QUARKUS_VERSION, quarkusVersion);
Expand Down Expand Up @@ -1425,6 +1431,9 @@ protected int runCamelVersion(KameletMain main) throws Exception {
cmds.removeIf(arg -> arg.startsWith("--jvm-debug"));
}

if (javaVersion != null) {
jbangArgs.add("--java-version=" + javaVersion);
}
if (repositories != null) {
jbangArgs.add("--repos=" + repositories);
}
Expand Down
Loading