mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-11-28 02:11:31 +08:00
Fix daemon not being reused when using --debug option (#1483)
Some checks failed
Early Access / Default build (without GraalVM) (push) Has been cancelled
Early Access / Build with GraalVM on macos-13 (push) Has been cancelled
Early Access / Build with GraalVM on macos-latest (push) Has been cancelled
Early Access / Build with GraalVM on ubuntu-latest (push) Has been cancelled
Early Access / Build with GraalVM on windows-latest (push) Has been cancelled
Early Access / Site build (push) Has been cancelled
Stale / stale (push) Has been cancelled
Some checks failed
Early Access / Default build (without GraalVM) (push) Has been cancelled
Early Access / Build with GraalVM on macos-13 (push) Has been cancelled
Early Access / Build with GraalVM on macos-latest (push) Has been cancelled
Early Access / Build with GraalVM on ubuntu-latest (push) Has been cancelled
Early Access / Build with GraalVM on windows-latest (push) Has been cancelled
Early Access / Site build (push) Has been cancelled
Stale / stale (push) Has been cancelled
This commit is contained in:
@@ -355,6 +355,15 @@ public class DefaultClient implements Client {
|
||||
});
|
||||
Environment.MVND_TERMINAL_WIDTH.addCommandLineOption(args, width);
|
||||
|
||||
if (parameters.property(Environment.MVND_DEBUG).asBoolean()) {
|
||||
if (Environment.MVND_KEEP_ALIVE.getCommandLineOption(args) == null) {
|
||||
System.setProperty(Environment.MVND_KEEP_ALIVE.getProperty(), "1h");
|
||||
}
|
||||
if (Environment.MVND_CONNECT_TIMEOUT.getCommandLineOption(args) == null) {
|
||||
System.setProperty(Environment.MVND_CONNECT_TIMEOUT.getProperty(), "1h");
|
||||
}
|
||||
}
|
||||
|
||||
final DaemonConnector connector = new DaemonConnector(parameters, registry);
|
||||
try (DaemonClientConnection daemon = connector.connect(output)) {
|
||||
output.setDaemonId(daemon.getDaemon().getId());
|
||||
|
||||
@@ -407,12 +407,6 @@ public class DaemonConnector {
|
||||
address = host + ":" + iPort;
|
||||
output.accept(Message.buildStatus("Daemon listening for debugger on address: " + address));
|
||||
args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=" + address);
|
||||
if (Environment.MVND_KEEP_ALIVE.getCommandLineOption(args) == null) {
|
||||
System.setProperty(Environment.MVND_KEEP_ALIVE.getProperty(), "1h");
|
||||
}
|
||||
if (Environment.MVND_CONNECT_TIMEOUT.getCommandLineOption(args) == null) {
|
||||
System.setProperty(Environment.MVND_CONNECT_TIMEOUT.getProperty(), "1h");
|
||||
}
|
||||
}
|
||||
// jvm args
|
||||
String jvmArgs = parameters.jvmArgs();
|
||||
|
||||
Reference in New Issue
Block a user