Skip to content

Commit

Permalink
Allow passing additional jvm args to the daemon, fixes apache#174
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Nov 6, 2020
1 parent b78d4c6 commit 204c247
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,15 @@ private Process startDaemon(String uid) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ public String maxHeapSize() {
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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ public String asCommandLineProperty(String value) {
* 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
*/
Expand Down

0 comments on commit 204c247

Please sign in to comment.