为什么Spring Boot会生成具有.original扩展名的jar或war文件? [英] Why spring boot generates jar or war file with .original extension?
问题描述
为什么在构建spring boot应用之后,它会生成两个扩展名为.original
的jar或war文件?我使用Spring Boot Maven构建插件.
例如:
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:
-
application.war
-
application.war.original
application.war
application.war.original
推荐答案
答案是您在spring-boot-maven-plugin
中使用了repackage
目标.
那么,它做什么呢?
The answer is that you are using repackage
goal in your spring-boot-maven-plugin
.
So, What it does?
Maven首先构建您的项目,并将您的类和资源打包到WAR (${artifactId}.war)
文件中.
Maven first builds your project and packages your classes and resources into a WAR (${artifactId}.war)
file.
然后,重新包装发生.为此,将pom.xml中提到的所有依赖项打包在一个新的WAR (${artifactId}.war)
中,并将先前生成的war重命名为${artifactId}.war.original
.
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
.
这篇关于为什么Spring Boot会生成具有.original扩展名的jar或war文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!