Exclude META-INF/maven folder from the generated jar file

You can use filters inside the maven-shade-plugin configuration to exclude everything that is under META-INF/maven for every artifact:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.4.1</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/maven/**</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
        </execution>
    </executions>
</plugin>

A solution for the maven-jar-plugin can be found here.


Simple add this to either it is a jar,war,ear plugin

<configuration>
   ....
  <archive>
    <addMavenDescriptor>false</addMavenDescriptor>
   </archive>
   ....
</configuration>