Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of spring-boot-maven-plugin

While creating a spring boot project I define property in pom.xml as <packaging>war</packaging> with which I can create a war and thereafter deploy the war into server maybe tomcat or WAS.
But I came across a plugin named spring-boot-maven-plugin whose documentation states that it's use is to package executable jar or war archives and run an application in-place.
My query is why do we need this at all ?
If my packaging can tell me what to create and then can deploy it to run, what is the used of this plugin.
I am trying to understand a new project so wanted to be sure that every line makes sense

like image 773
Always a newComer Avatar asked Oct 17 '22 17:10

Always a newComer


1 Answers

The maven plugin will create an "executable" archive. In the case of the war packaging, you would be able to execute your app with java -jar my-app.war. If you intend to deploy your Spring Boot application in an existing Servlet container, then this plugin is, indeed, not necessary.

The maven plugin does more things like running your app from the shell or creating build information.

Check the documentation

like image 131
Stephane Nicoll Avatar answered Oct 21 '22 05:10

Stephane Nicoll