io.quarkus.cli.common.PropertiesOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-cli Show documentation
Show all versions of quarkus-cli Show documentation
Quarkus command line utility
package io.quarkus.cli.common;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import picocli.CommandLine;
public class PropertiesOptions {
public Map properties = new HashMap<>();
@CommandLine.Option(names = "-D", mapFallbackValue = "", description = "Java properties")
void setProperty(Map props) {
this.properties = props;
}
public void flattenJvmArgs(List jvmArgs, Collection args) {
String jvmArgProperty = properties.remove("jvm.args");
if (jvmArgProperty != null && !jvmArgProperty.isBlank()) {
jvmArgs.add(jvmArgProperty);
}
if (!jvmArgs.isEmpty()) {
args.add("-Djvm.args='" + String.join(" ", jvmArgs) + "'");
}
}
@Override
public String toString() {
return properties.toString();
}
}