Mihai238
Mihai238

Reputation: 1137

Why does Spring Boot generates a jar?

Why does Spring Boot generates a jar file output, since a jar could not be deployed to a container or an application server?

It's nice to get it quickly set up (with an embedded container), but eventually you will have to build a war file in order to deploy the application properly.

Furthermore, it is a good choice to stick with spring boot also when the project is in production? From my point of view spring boot is just as a quick way to get started, but I'm not sure about it's reliability.

Upvotes: 1

Views: 197

Answers (2)

Lukas Hinsch
Lukas Hinsch

Reputation: 1860

The idea behind the jar is that you can run your app standalone without any container (see http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#getting-started-first-application-executable-jar).

Upvotes: 2

seenukarthi
seenukarthi

Reputation: 8624

Spring boot creates the jar/war based of the build tool packaging configuration. If you mention the packaging type as war then spring boot will create .war file.

Use the following configurations then you will get .war.

Maven

<packaging>war</packaging>

Gradle

apply plugin: 'war'

Upvotes: 2

Related Questions