Вот мой код, с которого я начинаю
task runElastic(type:Exec, dependsOn: ['taskUnzip']) {
workingDir "${buildDir}/unpacked/dist/elasticsearch-7.6.0/bin"
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'elasticsearch.bat'
} else {
commandLine './elasticsearch'
}
}
Может быть, я смогу получить pid процесса и убить их?