I\'m about to build my first website in Java with Spring Framework using Spring Boot and it\'s much easier to build it in jar, but I have a few questions about
spring-boot application as fat *.jarIt is possible to build so called fat JAR that is executable *.jar file with embedded application container (Tomcat as default option).
There are spring-boot plugins for various build systems. Here is the one for maven: spring-boot-maven-plugin
To execute the kind of fat *.jar you could simple run command:
java -jar *.jar
Or using spring-boot-maven goal:
mvn spring-boot:run
spring-boot application as *.war archiveThe other option is to ship your application as old-fashioned war file. It could be deployed to any servlet container out there. Here is step by step how-to list:
packaging to war (talking about maven's pom.xml)spring-boot application class from SpringBootServletInitializer and override SpringApplicationBuilder configure(SpringApplicationBuilder) method (see javadoc)scope of spring-boot-starter-tomcat as providedMore info in spring-boot documentation