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 --no-daemon.
Is there a better way to catch a SIGINT and ensure the JavaExec task gets killed instead of still running in background?
The JavaExec task spins some application code under development that opens TCP servers. I would just expect a SIGINT to also cleanup the background jobs.