Java – Spring boot application in windows server

javaspring-boottomcatwindows-server

I am planning to deploy a web application built on spring boot in windows server.

I want to use tomcat container.

Can I deploy the spring boot fat jar directly or is it recommended to deploy the war file.

please suggest how to deploy and the preferred method?

Best Answer

As Josh Long likes to say "Make Jar not War!" It really allows an application to have flexibility on where it can be run and allows for everything to be packaged as one artifact. Windows has no issue running the embedded Tomcat that is part of Spring Boot and that is exactly what it is doing when running it in your IDE. The one edge case to this is keeping the process running on the server. Normally in Windows you would do that by setting up a service and having that service run java -jar myapp.jar. I haven't personally seen it done so might take some playing around but it is possible.