I\'m trying to fix a spring-batch job which is launched from a shell script. The script then checks the process exit code to determine whether the job has succeeded. Java, h
I solved this some time ago - apologies that I did not update sooner.
Spring Batch does exit non-zero on an failed job, but there's a subtle catch.
If a job step has no transitions explicitly defined it will by default end the job on success and fail the job on failure (of the step).
If, however, the step has a transition defined for any result (e.g. to the next step on success), there is no default transition for any other result, and if it fails the job won't be properly failed. So you have to explicitly define a "fail on FAILED" transition (typically, for all steps except the last).