Spring boot

To run a spring boot application by itself (simply using java -jar) we can build executable jar that contains all dependencies inside it. For that we need bootJar task. jar task is not enough. If we want to deploy application to a container, we then need to generate a war file.

jar or war only builds normal archives. bootJar and bootWar builds executable archives.Applying java plugin automatically adds bootRun task that builds a jar we can execute using java -jar. Applying a war plugin adds a bootWar task that builds the war we can execute.

The assemble task is automatically configured to depend upon the bootJar task so running assemble (or build) will also run the bootJar task. Running assemble or build will also run the bootWar task

 

Leave a comment