From 5f934cc6945bf6c0bec910a2ada052597ea1e5ed Mon Sep 17 00:00:00 2001 From: Michal Jurc Date: Tue, 13 Aug 2024 16:42:21 +0200 Subject: [PATCH] Use snapshot in builds with snapshot CLI * When snapshot version of Quarkus is used, the quarkus.version property should be set to 999-SNAPSHOT with build CLI command --- .../java/io/quarkus/test/bootstrap/QuarkusCliClient.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quarkus-test-cli/src/main/java/io/quarkus/test/bootstrap/QuarkusCliClient.java b/quarkus-test-cli/src/main/java/io/quarkus/test/bootstrap/QuarkusCliClient.java index 250881e50..662766892 100644 --- a/quarkus-test-cli/src/main/java/io/quarkus/test/bootstrap/QuarkusCliClient.java +++ b/quarkus-test-cli/src/main/java/io/quarkus/test/bootstrap/QuarkusCliClient.java @@ -30,6 +30,7 @@ public class QuarkusCliClient { public static final String COMMAND_LOG_FILE = "quarkus-cli-command.out"; public static final String DEV_MODE_LOG_FILE = "quarkus-cli-dev.out"; + private static final String QUARKUS_VERSION_PROPERTY_NAME = "quarkus.version"; private static final String QUARKUS_UPSTREAM_VERSION = "999-SNAPSHOT"; private static final String BUILD = "build"; private static final PropertyLookup COMMAND = new PropertyLookup("ts.quarkus.cli.cmd", "quarkus"); @@ -52,6 +53,9 @@ public Result run(String... args) { public Result buildApplicationOnJvm(Path serviceFolder, String... extraArgs) { List args = new ArrayList<>(); args.add(BUILD); + if (isUpstream()) { + args.add("-D" + QUARKUS_VERSION_PROPERTY_NAME + "=" + QUARKUS_UPSTREAM_VERSION); + } args.addAll(Arrays.asList(extraArgs)); return runCliAndWait(serviceFolder, args.toArray(new String[args.size()])); } @@ -60,6 +64,9 @@ public Result buildApplicationOnNative(Path serviceFolder, String... extraArgs) List args = new ArrayList<>(); args.add(BUILD); args.add("--native"); + if (isUpstream()) { + args.add("-D" + QUARKUS_VERSION_PROPERTY_NAME + "=" + QUARKUS_UPSTREAM_VERSION); + } args.addAll(Arrays.asList(extraArgs)); return runCliAndWait(serviceFolder, args.toArray(new String[args.size()])); }