Search code examples
mavenmaven-pluginmaven-assembly-plugin

maven-assembly-plugin: Excluding files


I have this piece of code in my pom.xml file

<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>       

but I have this error: Element packagingExcludes is not allowed here


Solution

  • packagingExcludes does not appear anywhere in maven-assembly.

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

    So you might not have that option available for making an archive with maven-assembly.