Deploying Spring Boot-Based Applications
Spring Boot applications are slightly different from tradition Java web applications (or Jakarta EE applications) in that they by default create a JAR
file with an embedded server in it, rather than a traditional WAR
file that’s deployed to a standalone Servlet container or fully featured Java EE server.
Alternatively, Spring Boot applications can be packaged as WAR
files, too.
See the Spring Boot documentation for instructions on 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’s needed
-
bigger package size
WAR
packaging:
-
a separate Java Servlet container is needed
-
free choice of servers, including Jetty, Tomcat, WildFly, GlassFish, and others
-
smaller package size
You can read more about Spring applications and how to deploy them on the official Spring website.