39

Why after building spring boot app, it generates two jar or war files with .original extension? I use spring boot maven build plugin. For example:

  1. application.jar
  2. application.jar.original
Tohid Makari
  • 1,700
  • 3
  • 15
  • 29

2 Answers2

40

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.

  • Nice Answer. In case of need to skip the repackage goal: https://stackoverflow.com/a/60398974/2183717. Works with spring boot 2.7.12 – pedrociarlini Aug 25 '23 at 19:56
7

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

lane.maxwell
  • 5,002
  • 1
  • 20
  • 30