Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why spring boot generates jar or war file with .original extension?

People also ask

Does spring boot create jar or war?

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.

Does spring boot generate a WAR file?

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.

What is difference between WAR file and JAR file?

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