Skip to content

Commit

Permalink
Enable to use java preview while executing built jar file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jedla97 committed Oct 4, 2023
1 parent 4c5aff5 commit 7849419
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@

import org.apache.commons.lang3.ArrayUtils;

import io.quarkus.test.configuration.PropertyLookup;

public class ProdLocalhostQuarkusApplicationManagedResource extends LocalhostQuarkusApplicationManagedResource {

private static final String JAVA = "java";
private static final String QUARKUS_ARGS_PROPERTY_NAME = "quarkus.args";
private static final String ENABLE_PREVIEW = "--enable-preview";
private static final PropertyLookup JAVA_ENABLE_PREVIEW = new PropertyLookup("ts.enable-java-preview", "false");

private final ProdQuarkusApplicationManagedResourceBuilder model;

Expand All @@ -25,6 +29,9 @@ protected List<String> prepareCommand(List<String> systemProperties) {
String[] cmdArgs = extractQuarkusArgs(systemProperties);
if (model.getArtifact().getFileName().toString().endsWith(".jar")) {
command.add(JAVA);
if (JAVA_ENABLE_PREVIEW.getAsBoolean()) {
command.add(ENABLE_PREVIEW);
}
command.addAll(systemProperties);
command.add("-jar");
command.add(model.getArtifact().toAbsolutePath().toString());
Expand Down

0 comments on commit 7849419

Please sign in to comment.