Filter maven-shade-plugin resources

I am trying to filter out the resources included in my bank. I use shade-maven-plugin, and this adds all the resources of all my dependencies to my created bank, I only want to include my project resources.

Here is my definition of pom:

    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <minimizeJar>true</minimizeJar>
                        <transformers>
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>es.app.applet.MyApplet</mainClass>
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
            <configuration>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
        </plugin>

I tried to add the following filter to remove all resources, and then add another filter that only adds my artifactID resources, but it does not work.

                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>resources/*.*</exclude>
                        </excludes>
                    </filter> <filter>
                        <artifact>my.groupId:my.artifactId</artifact>
                        <includes>
                            <include>resources/*.*</include>
                        </includes>
                    </filter>

Ideas?

Thank.

+5
source share
1 answer

This is because the filter includes events until the filter is thrown.

With the code, you include "my.groupId: my.artifactId" -> resources /.

But instead, you exclude all "resources /."

:

, , , include .

+2

All Articles