Ich schaue diese Dokumentation hier an: https://docs.gradle.org/3.4.1/dsl/org.gradle.api.tasks.Exec.html, die ein Beispiel gibt, wie man Tomcat ein-/ausschalten kann.Gradle Exec Aufgabe zum Stoppen von Tomcat
Allerdings ist nicht genau erklärt, was genau Parameter CommandLine erwartet.
Also, der folgende Code ist fehlgeschlagen. Könnten Sie bitte irgendwelche Gedanken teilen?
task stopTomcat(type:Exec) {
println "$System.env.TOMCAT"
workingDir "${System.env.TOMCAT}" + '/bin/'
//on windows:
commandLine './catalina.sh stop'
//on linux
//commandLine './stop.sh'
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method stopTomcat.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
Ich habe wie oben meine Aufgabe konfiguriert, aber es funktioniert nicht, wenn ich die Aufgabe auszuführen. net.rubygrapefruit.platform.NativeException:
von Verursacht konnte nicht start './catalina zu stoppen'