mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-23 12:48:26 +00:00
Allow passing additional jvm args to the daemon, fixes #174
This commit is contained in:

committed by
Peter Palaga

parent
a6e4c47aaa
commit
97cde29e84
@@ -258,6 +258,15 @@ public class DaemonConnector {
|
||||
if (parameters.property(Environment.DAEMON_DEBUG).asBoolean()) {
|
||||
args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000");
|
||||
}
|
||||
// jvm args
|
||||
String jvmArgs = parameters.jvmArgs();
|
||||
if (jvmArgs != null) {
|
||||
for (String arg : jvmArgs.split(" ")) {
|
||||
if (!arg.isEmpty()) {
|
||||
args.add(arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
// memory
|
||||
String minHeapSize = parameters.minHeapSize();
|
||||
if (minHeapSize != null) {
|
||||
|
@@ -199,6 +199,10 @@ public class DaemonParameters {
|
||||
return property(Environment.DAEMON_MAX_HEAP_SIZE).asString();
|
||||
}
|
||||
|
||||
public String jvmArgs() {
|
||||
return property(Environment.DAEMON_JVM_ARGS).asString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the number of threads (same syntax as Maven's {@code -T}/{@code --threads} option) to pass to the daemon
|
||||
* unless the user passes his own `-T` or `--threads`.
|
||||
|
@@ -113,6 +113,10 @@ public enum Environment {
|
||||
* JVM options for the daemon
|
||||
*/
|
||||
DAEMON_MAX_HEAP_SIZE("daemon.maxHeapSize", null, "2G", true),
|
||||
/**
|
||||
* Additional JVM args for the daemon
|
||||
*/
|
||||
DAEMON_JVM_ARGS("daemon.jvmArgs", null, "", true),
|
||||
/**
|
||||
* JVM options for the daemon
|
||||
*/
|
||||
|
Reference in New Issue
Block a user