maven-assembly-plugin:排除文件

maven-assembly-plugin: Excluding files

我的 pom.xml 文件中有这段代码

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>             
                    <descriptors>
                        <descriptor>assembly.xml</descriptor>
                    </descriptors>
                    <finalName>elcordelaciutat-${project.version}</finalName>
                    <packagingExcludes>***/*.pom</packagingExcludes>                                                    
                </configuration>
                                
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>       

但是我有这个错误:Element packagingExcludes is not allowed here

packagingExcludes 没有 appear anywhere in maven-assembly.

issues related to packagingExcludes involve projects like apache/maven-war-plugin, which does declare packagingExcludes in WarMojo.java

所以您可能无法使用 maven-assembly 进行存档的选项。