这个问题在这里已经有了答案:
Why spring boot generates jar or war file with .original extension?
(2 个回答)
1年前关闭。
我正在处理 Spring boot
版本2.2.1.RELEASE
.在构建我的项目时,将创建两个 jar 类型 executable jar file
和 original file
如下所示
这样做的原因是
Maven first builds my project and packages my classes and resources into a jar (${artifactId}.jar) file.
Then, repackaging happens. In this goal, all the dependencies mentioned in the pom.xml are packaged inside a new WAR (${artifactId}.jar) and the previously generated war is renamed to ${artifactId}.jar.original.
xml文件
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.data.MainService</mainClass>
</configuration>
</plugin>
</plugins>
</build>
我们如何避免创建
ORIGINAL File
输入jar文件。Maven 中是否有任何禁用/排除技术可用。
我也试过关注
<build>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.data.MainService</mainClass>
</configuration>
</plugin>
</plugins>
</build>
最佳答案
根据实现 jar.original 是预期的。没什么可担心的。
重新打包会创建新的 jar 文件并将旧的文件重命名为 jar.original
关于Spring Boot 2.2.1 在 Build 时创建两个 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59098178/