Spring Boot runnable Jar file for production?

341 Views Asked by At

Is spring boot runnable jar file meant for production environments with any optimizations needed for production or it is meant for testing/prototyping and we should generate and deploy WAR files on app servers in the prod machines?

2

There are 2 best solutions below

0
On BEST ANSWER

You can use the .jar for production too. Jars are easy to create. Spring boot jar can simply be managed automatically by the production server, i.e. restart the jar and etc.

It also has embedded Tomcat and the Tomcat configuration can be modified and optimized using the .properties file or inside Java if you need that.

Generally, there are almost no reason to use .war over .jar, but it is up to you what you prefer.

0
On

It is perfectly suited for Prod envs. You can check https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#server-properties to see how you can configure your server.