More explicit handling of jps executable on Windows
This commit is contained in:
parent
4cd8d0a815
commit
bfe27407ae
|
@ -286,12 +286,14 @@ class ClusterFormationTasks {
|
||||||
onlyIf { pidFile.exists() }
|
onlyIf { pidFile.exists() }
|
||||||
// the pid file won't actually be read until execution time, since the read is wrapped within an inner closure of the GString
|
// the pid file won't actually be read until execution time, since the read is wrapped within an inner closure of the GString
|
||||||
ext.pid = "${ -> pidFile.getText('UTF-8').trim()}"
|
ext.pid = "${ -> pidFile.getText('UTF-8').trim()}"
|
||||||
File jps = getJpsExecutableByName("jps")
|
File jps
|
||||||
if (!jps.exists()) {
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
jps = getJpsExecutableByName("jps.exe")
|
jps = getJpsExecutableByName("jps.exe")
|
||||||
if (!jps.exists()) {
|
} else {
|
||||||
throw new GradleException("jps executable not found; ensure that you're running Gradle with the JDK rather than the JRE")
|
jps = getJpsExecutableByName("jps")
|
||||||
}
|
}
|
||||||
|
if (!jps.exists()) {
|
||||||
|
throw new GradleException("jps executable not found; ensure that you're running Gradle with the JDK rather than the JRE")
|
||||||
}
|
}
|
||||||
commandLine jps, '-l'
|
commandLine jps, '-l'
|
||||||
standardOutput = new ByteArrayOutputStream()
|
standardOutput = new ByteArrayOutputStream()
|
||||||
|
|
Loading…
Reference in New Issue