Interview questions
Question 172 of 254
FreeWhat is the difference between packaging a Spring Boot app as a JAR versus a WAR?
Deployment & Production
A JAR with an embedded server is fully self-contained and runs standalone via `java -jar` — the standard, recommended approach for Spring Boot apps, especially in containerized deployments. A WAR is built for deployment into an external, pre-existing servlet container (like a standalone Tomcat installation) — supported by extending `SpringBootServletInitializer`, but mainly relevant for organizations with existing infrastructure requiring deployment into a shared, externally managed application server rather than each app bringing its own embedded one.
Intermediate5 min
