I have a JavaExec
task like this:
tasks.register("run-MyLoader", JavaExec) {
//jvmArgs = ['-Xmx1g']
group = ApplicationPlugin.APPLICATION_GROUP
classpath = sourceSets.main.runtimeClasspath
mainClass = 'my.run.package.MyLoader'
}
I run this task in a shell script via:
gradle -p /path/to/gradle/project run-MyLoader
Most of the time everything goes fine. (Things get compiled and run and afterwards the shell script can continue working on the results.) So far so good.
Sometimes the running fails with an exception in one of my just compiled Java classes - but afterwards when control comes back to the shell script it still continues .
How can pass through to the shell script the fact that the JavaExec
task failed?