2

Spring Boot can build executable .jar or .war files. Is there any difference between them, besides the file extension?

The documentation states You should configure your project to build a jar or war (as appropriate). For a Spring MVC web application, is in inappropriate (for technical reasons) to build an executable .jar instead of an executable .war?

Brian Beckett
  • 4,742
  • 6
  • 33
  • 52

1 Answers1

9

Generally speaking, when you're using an embedded container, you should stick to the defaults and build a jar file.

There are, however, two exceptions to that rule:

  1. You want to use JSPs. In that case you'll need to use war packaging as Tomcat's JSP support is tightly coupled to the layout of a war file.
  2. You want to have the option of also deploying your application to a standalone container or app server.
Andy Wilkinson
  • 108,729
  • 24
  • 257
  • 242