Deploying to Production

Spring Boot applications are slightly different to tradition Java web applications (or Jakarta EE applications) in that they by default create a JAR file with embedded server in it, rather than traditional WAR file that is deployed on a standalone Servlet container or fully featured Java EE server.

Alternatively, Spring Boot applications can be packaged as WAR files as well. Follow the instructions in Spring Boot documentation how to do this.

The main differences between JAR and WAR packaging are as follows:

JAR packaging:

  • No need for a server binary install, a Java Runtime is all that is needed.

  • Bigger package size.

WAR packaging:

  • a separate Java Servlet container needed

  • free choice of servers, including Jetty, Tomcat, WildFly, GlassFish, and others

  • smaller package size

See Using Spring Boot Properties for additional details.

You can read more about Spring applications and how to deploy them at the official Spring website.