I’m having a
JavaExec task that runs some server code, but I find myself trapped by the Gradle behaviour when hitting Ctrl+C to stop it when using the Gradle daemon mode (which is the default).
The forked server stills runs in the background, so the only option is to run my Gradle build and task with
Is there a better way to catch a SIGINT and ensure the
JavaExec task gets killed instead of still running in background?