私はここでこのドキュメントを参照しています:https://docs.gradle.org/3.4.1/dsl/org.gradle.api.tasks.Exec.htmlここではtomcatをオフ/オンする方法の例を示します。tomcatを終了するためのGradle Execタスク
ただし、commandLineがどのようなパラメータを期待しているのかはよく分かりません。
したがって、以下のコードは失敗しています。あなたは何か考えを共有してください。
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()
}
}
私は上記のように、私のタスクを設定しているが、私は、タスクを実行すると、それは失敗しません。 net.rubygrapefruit.platform.NativeException:によって引き起こさ
できませんでした 開始