0

The following section shows the configuration for the shade plugin in my pom.xml:

 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.4</version>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>shade</goal>
        </goals>
        <configuration>
          <artifactSet>
            <excludes>
              <exclude>META-INF/*.SF</exclude> 
              <exclude>META-INF/*.DSA</exclude> 
              <exclude>META-INF/*.RSA</exclude> 
              <exclude>META-INF/ECLIPSE*</exclude> 
          </excludes>
          </artifactSet>
        </configuration>
      </execution>
    </executions>
  </plugin>

However some files that were (it seems??) excluded were sneaking into the output jar file:

02:19:43/xt $jar -tvf target/ignitedemo-1.0-SNAPSHOT.jar | grep  META | egrep "RSA|DSA|SF"
  9958 Sun Jul 05 02:19:26 PDT 2015 META-INF/ECLIPSEF.SF
  5639 Sun Jul 05 02:19:26 PDT 2015 META-INF/ECLIPSEF.RSA

So then what is incorrect in the shade plugin configuration?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560

2 Answers2

1

<artifactSet> is used to include/exclude artifacts but it is not the right place to exclude single files.

You need to use <filters> for that:

<filter>
  <artifact>*:*</artifact>
  <excludes>
    <exclude>META-INF/*.SF</exclude> 
    <exclude>META-INF/*.DSA</exclude> 
    <exclude>META-INF/*.RSA</exclude> 
    <exclude>META-INF/ECLIPSE*</exclude> 
  </excludes>
</filter>
Stefan Ferstl
  • 5,135
  • 3
  • 33
  • 41
1

With artifactSet you specify which artifacts should be excluded. You must use filters, see http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html

(ps. how this you get to your pom configuration?)

Robert Scholte
  • 11,889
  • 2
  • 35
  • 44