Spring boot\'s preferred deployment method is via a executable jar file which contains tomcat inside.
It is started with a simple java -jar myapp.jar
.>
You can use the application called Supervisor. In supervisor config you can define multiple services and ways to execute the same.
For Java and Spring boot applications the command would be
java -jar springbootapp.jar
.
Options can be provided to keep the application running always.So if the EC2 restart then Supervisor will restart you application
I found Supervisor easy to use compared to putting startup scripts in /etc/init.d/.The startup scripts would hang or go into waiting state in case of errors .