I'm complete able to configure spring boot in both cases, the question here is which of them are more robust and is the more recommended, because I didn't find in the spring boot documentation the recommended way to deploy it in a production environment, my concerns about use the embedded container are:
- If I want to set it as a Windows or Linux service, is the jar file the best option?
- If I use the jar file I'm not going to have access to restart the server.
- Maybe in the future I need more applications in the same container.
- If I restart the machine I have to execute again the java -jar.
The question in general is which is better use the jar file and execute it as java -jar jarname.jar in production or change the packaging to war set the tomcat as provided and set the generated war in an empty tomcat.
I hope you can help me.
---EDIT---
Many times the answer is depends, this is for a normal web application or REST web service.
--spring.config.location
to the script that starts the application. The param specifies alternative config-files. This way we externalized the DB-Config including access data, but it is also a way to preserve configuration when upgrading the application. – Andy