This message was deleted.
# community-support
s
This message was deleted.
f
There is no cross-platform way to achieve this in Java. Also, the program you want to execute in the background might hang, in which case it is quickly becoming a zombie process, since nobody knows that there is a process lingering around. Exactly the same can happen with
&
in a shell. This is the reason why there are so many programs out there to manage background processes. 😉 Use
Exec
, but wrap it in a daemon thread that executes in the background without disturbing your main process. And, be sure to give it a timeout!
s
Use Exec, but wrap it in a daemon thread that executes in the background without disturbing your main process
Would you have some reference for this ? I’m wondering if this feature supported by exec or do you mean just running this in a separate thread on the jvm. My usecase is that I need to trigger some scripts in the beginning and end of a build, however I do not want that that to increase the duration of the build process in itself.
f
Java thread. Others had a similar desire before, maybe this stuff helps you: • https://github.com/gradle/gradle/issues/1367#issuecomment-1028044555 • https://github.com/psxpaul/gradle-execfork-plugin
s
Thank you! I will look into these.