为什么 spring-boot-maven 插件在重新打包覆盖的 war 文件时会添加 war 本身?

Why is the spring-boot-maven plugin adding the war itself when repackaging an overlayed war file?

我有以下 pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.example</groupId>
    <artifactId>foo-war</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>org.jasig.portlet</groupId>
            <artifactId>CalendarPortlet</artifactId>
            <version>2.6.2</version>
            <type>war</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.6.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>build-info</goal>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <overlays>
                        <overlay>
                            <groupId>org.jasig.portlet</groupId>
                            <artifactId>CalendarPortlet</artifactId>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

当我 运行 mvn package 生成的重新打包的 war 文件在 WEB-INF/lib/CalendarPortlet-2.6.2.war.

下包含原始 war 本身

为什么 spring-boot 在重新打包时添加 war,我该如何防止这种情况?

在我的实际项目中,我想替换已经存在的一些资源 war 并添加构建信息以供执行器显示。但是将工件的大小加倍是不可行的。

编辑:
重新打包 jar 时也会出现此问题。

可以通过在 spring-boot-maven 插件的配置中手动指定该工件的 exlclude 来防止原始工件包含在重新打包的工件中:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>2.1.6.RELEASE</version>
    <configuration>
        <excludes>
            <exclude>
                <groupId>org.jasig.portlet</groupId>
                <artifactId>CalendarPortlet</artifactId>
            </exclude>
        </excludes>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>build-info</goal>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>

但我仍然不知道为什么那个插件在重新打包的插件中包含原始工件。