Clean the names of properties, fixes #221

This commit is contained in:
Guillaume Nodet
2020-11-16 09:50:17 +01:00
parent 1ac48446de
commit 668d4e4526
9 changed files with 87 additions and 47 deletions

View File

@@ -127,9 +127,9 @@ public class DaemonConnector {
properties.put(Environment.USER_DIR.getProperty(), parameters.userDir().toString());
properties.put(Environment.USER_HOME.getProperty(), parameters.userHome().toString());
properties.put(Environment.MVND_HOME.getProperty(), parameters.mvndHome().toString());
properties.put(Environment.DAEMON_UID.getProperty(), daemon);
properties.put(Environment.MVND_UID.getProperty(), daemon);
properties.put(Environment.MVND_DAEMON_STORAGE.getProperty(), parameters.daemonStorage().toString());
properties.put(Environment.DAEMON_REGISTRY.getProperty(), parameters.registry().toString());
properties.put(Environment.MVND_REGISTRY.getProperty(), parameters.registry().toString());
properties.putAll(parameters.getDaemonOptsMap());
Environment.setProperties(properties);
AtomicReference<Throwable> throwable = new AtomicReference<>();
@@ -305,7 +305,7 @@ public class DaemonConnector {
final String classpath = mvndHome.resolve(mvndCommonPath).toString();
args.add(classpath);
// debug options
if (parameters.property(Environment.DAEMON_DEBUG).asBoolean()) {
if (parameters.property(Environment.MVND_DEBUG).asBoolean()) {
args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000");
}
// jvm args
@@ -330,9 +330,9 @@ public class DaemonConnector {
args.add(Environment.MVND_HOME.asCommandLineProperty(mvndHome.toString()));
args.add(Environment.LOGBACK_CONFIGURATION_FILE
.asCommandLineProperty(parameters.logbackConfigurationPath().toString()));
args.add(Environment.DAEMON_UID.asCommandLineProperty(uid));
args.add(Environment.MVND_UID.asCommandLineProperty(uid));
args.add(Environment.MVND_DAEMON_STORAGE.asCommandLineProperty(parameters.daemonStorage().toString()));
args.add(Environment.DAEMON_REGISTRY.asCommandLineProperty(parameters.registry().toString()));
args.add(Environment.MVND_REGISTRY.asCommandLineProperty(parameters.registry().toString()));
args.addAll(parameters.getDaemonCommandLineProperties());
args.add(MavenDaemon.class.getName());
command = String.join(" ", args);

View File

@@ -209,15 +209,15 @@ public class DaemonParameters {
}
public String minHeapSize() {
return property(Environment.DAEMON_MIN_HEAP_SIZE).asString();
return property(Environment.MVND_MIN_HEAP_SIZE).asString();
}
public String maxHeapSize() {
return property(Environment.DAEMON_MAX_HEAP_SIZE).asString();
return property(Environment.MVND_MAX_HEAP_SIZE).asString();
}
public String jvmArgs() {
return property(Environment.DAEMON_JVM_ARGS).asString();
return property(Environment.MVND_JVM_ARGS).asString();
}
/**
@@ -273,11 +273,11 @@ public class DaemonParameters {
}
public Duration keepAlive() {
return property(Environment.DAEMON_KEEP_ALIVE).orFail().asDuration();
return property(Environment.MVND_KEEP_ALIVE).orFail().asDuration();
}
public int maxLostKeepAlive() {
return property(Environment.DAEMON_MAX_LOST_KEEP_ALIVE).orFail().asInt();
return property(Environment.MVND_MAX_LOST_KEEP_ALIVE).orFail().asInt();
}
public boolean noBuffering() {
@@ -337,10 +337,10 @@ public class DaemonParameters {
}
private String defaultValue(Environment env) {
if (env == Environment.DAEMON_EXT_CLASSPATH) {
if (env == Environment.MVND_EXT_CLASSPATH) {
List<String> cp = parseExtClasspath(userHome());
return String.join(",", cp);
} else if (env == Environment.DAEMON_CORE_EXTENSIONS) {
} else if (env == Environment.MVND_CORE_EXTENSIONS) {
try {
List<String> extensions = readCoreExtensionsDescriptor(multiModuleProjectDirectory()).stream()
.map(e -> e.getGroupId() + ":" + e.getArtifactId() + ":" + e.getVersion())