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
As per this github issue it's recommended to pass the result of SpringApplication#exit to System#exit. You don't need to access an ExitCodeGenerator instance directly or manually close the context.
ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
int exitCode = SpringApplication.exit(context);
System.exit(exitCode);