Skip to content

Instantly share code, notes, and snippets.

@jlandure
Created July 25, 2014 07:47
Show Gist options
  • Select an option

  • Save jlandure/e33d3b7946023c0b88cb to your computer and use it in GitHub Desktop.

Select an option

Save jlandure/e33d3b7946023c0b88cb to your computer and use it in GitHub Desktop.
shade plugin avec appending de spring.handlers
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-jar-with-dependencies</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>utils.BatchDaemon</Main-Class>
</manifestEntries>
</transformer>
</transformers>
<!-- needed because we have two directories named 'Resources' and 'resources' and 7Z is case sensitive -->
<relocations>
<relocation>
<pattern>Resources</pattern>
<shadedPattern>resources</shadedPattern>
</relocation>
<relocation>
<pattern>meta-inf</pattern>
<shadedPattern>META-INF</shadedPattern>
</relocation>
</relocations>
<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>
<exclude>LICENSE</exclude>
<exclude>LICENSE.txt</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/license.txt</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
<exclude>META-INF/notice.txt</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment