The spring-boot-loader modules lets Spring Boot support executable jar and war files. If you use the Maven plugin or the Gradle plugin, executable jars are automatically generated, and you generally do not need to know the details of how they work.
Spring boot war is defined as creating packaging of application as a war file. As we know that default packaging of the application is jar is deployed on tomcat server. We can also generate war file deployment of spring boot applications by using tomcat, JBoss, and weblogic server instances.
JAR files allow us to package multiple files in order to use it as a library, plugin, or any kind of application. On the other hand, WAR files are used only for web applications. The structure of the archives is also different. We can create a JAR with any desired structure.
The answer is that you are using repackage
goal in your spring-boot-maven-plugin
.
So, What it does?
Maven first builds your project and packages your classes and resources into a WAR (${artifactId}.war)
file.
Then, repackaging happens. In this goal, all the dependencies mentioned in the pom.xml are packaged inside a new WAR (${artifactId}.war)
and the previously generated war is renamed to ${artifactId}.war.original
.
I assume that you're using the spring boot maven build plugin. This behavior is documented here: https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With