Skip to content

Commit

Permalink
accept Quarkus and SpringBoot versions as system properties as a fix …
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszpop committed Jan 24, 2025
1 parent d8f63a8 commit eda8f87
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
Expand Down Expand Up @@ -63,6 +64,7 @@
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.StringHelper;
import picocli.CommandLine;
import picocli.CommandLine.Option;

public abstract class ExportBaseCommand extends CamelCommand {

Expand Down Expand Up @@ -157,8 +159,8 @@ public abstract class ExportBaseCommand extends CamelCommand {
protected String localKameletDir;

@CommandLine.Option(names = { "--spring-boot-version" }, description = "Spring Boot version",
defaultValue = RuntimeType.SPRING_BOOT_VERSION)
protected String springBootVersion = RuntimeType.SPRING_BOOT_VERSION;
defaultValue = "${sys:camel.jbang.springBootVersion:-" + RuntimeType.SPRING_BOOT_VERSION + "}")
protected String springBootVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.springBootVersion"), RuntimeType.SPRING_BOOT_VERSION);

@CommandLine.Option(names = { "--camel-spring-boot-version" }, description = "Camel version to use with Spring Boot")
protected String camelSpringBootVersion;
Expand All @@ -172,8 +174,8 @@ public abstract class ExportBaseCommand extends CamelCommand {
protected String quarkusArtifactId = "quarkus-bom";

@CommandLine.Option(names = { "--quarkus-version" }, description = "Quarkus Platform version",
defaultValue = RuntimeType.QUARKUS_VERSION)
protected String quarkusVersion = RuntimeType.QUARKUS_VERSION;
defaultValue = "${sys:camel.jbang.quarkusVersion:-" + RuntimeType.QUARKUS_VERSION + "}")
protected String quarkusVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.quarkusVersion"), RuntimeType.QUARKUS_VERSION);

@CommandLine.Option(names = { "--maven-wrapper" }, defaultValue = "true",
description = "Include Maven Wrapper files in exported project")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ public class Run extends CamelCommand {
String quarkusArtifactId = "quarkus-bom";

@Option(names = { "--quarkus-version" }, description = "Quarkus Platform version",
defaultValue = RuntimeType.QUARKUS_VERSION)
String quarkusVersion = RuntimeType.QUARKUS_VERSION;
defaultValue = "${sys:camel.jbang.quarkusVersion:-" + RuntimeType.QUARKUS_VERSION + "}")
String quarkusVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.quarkusVersion"), RuntimeType.QUARKUS_VERSION);

@Option(names = { "--spring-boot-version" }, description = "Spring Boot version",
defaultValue = RuntimeType.SPRING_BOOT_VERSION)
String springBootVersion = RuntimeType.SPRING_BOOT_VERSION;
defaultValue = "${sys:camel.jbang.springBootVersion:-" + RuntimeType.SPRING_BOOT_VERSION + "}")
String springBootVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.springBootVersion"), RuntimeType.SPRING_BOOT_VERSION);

@Option(names = { "--profile" }, scope = CommandLine.ScopeType.INHERIT, defaultValue = "dev",
description = "Profile to run (dev, test, or prod).")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public abstract class CatalogBaseCommand extends CamelCommand {
RuntimeType runtime;

@CommandLine.Option(names = { "--quarkus-version" }, description = "Quarkus Platform version",
defaultValue = RuntimeType.QUARKUS_VERSION)
String quarkusVersion;
defaultValue = "${sys:camel.jbang.quarkusVersion:-" + RuntimeType.QUARKUS_VERSION + "}")
String quarkusVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.quarkusVersion"), RuntimeType.QUARKUS_VERSION);

@CommandLine.Option(names = { "--quarkus-group-id" }, description = "Quarkus Platform Maven groupId",
defaultValue = "io.quarkus.platform")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public class CatalogDoc extends CamelCommand {
RuntimeType runtime;

@CommandLine.Option(names = { "--quarkus-version" }, description = "Quarkus Platform version",
defaultValue = RuntimeType.QUARKUS_VERSION)
String quarkusVersion;
defaultValue = "${sys:camel.jbang.quarkusVersion:-" + RuntimeType.QUARKUS_VERSION + "}")
String quarkusVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.quarkusVersion"), RuntimeType.QUARKUS_VERSION);

@CommandLine.Option(names = { "--quarkus-group-id" }, description = "Quarkus Platform Maven groupId",
defaultValue = "io.quarkus.platform")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

import io.fabric8.kubernetes.api.model.Pod;
Expand Down Expand Up @@ -216,8 +217,8 @@ public class KubernetesRun extends KubernetesBaseCommand {
String localKameletDir;

@CommandLine.Option(names = { "--spring-boot-version" }, description = "Spring Boot version",
defaultValue = RuntimeType.SPRING_BOOT_VERSION)
String springBootVersion = RuntimeType.SPRING_BOOT_VERSION;
defaultValue = "${sys:camel.jbang.springBootVersion:-" + RuntimeType.SPRING_BOOT_VERSION + "}")
String springBootVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.springBootVersion"), RuntimeType.SPRING_BOOT_VERSION);

@CommandLine.Option(names = { "--camel-spring-boot-version" }, description = "Camel version to use with Spring Boot")
String camelSpringBootVersion;
Expand All @@ -231,8 +232,8 @@ public class KubernetesRun extends KubernetesBaseCommand {
String quarkusArtifactId = "quarkus-bom";

@CommandLine.Option(names = { "--quarkus-version" }, description = "Quarkus Platform version",
defaultValue = RuntimeType.QUARKUS_VERSION)
String quarkusVersion = RuntimeType.QUARKUS_VERSION;
defaultValue = "${sys:camel.jbang.quarkusVersion:-" + RuntimeType.QUARKUS_VERSION + "}")
String quarkusVersion = Objects.requireNonNullElse(System.getProperty("camel.jbang.quarkusVersion"), RuntimeType.QUARKUS_VERSION);

@CommandLine.Option(names = { "--package-name" },
description = "For Java source files should they have the given package name. By default the package name is computed from the Maven GAV. "
Expand Down

0 comments on commit eda8f87

Please sign in to comment.