Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
pom example for maven-shade-plugin blog
<project>
<groupId>com.jyates</groupId>
<artifactId>camel-netty4-http-shaded</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Shaded Camel Netty4 Http</name>
<description>Version of camel-netty4-http that shades the netty dependency so we can
leverage other versions of netty elsewhere</description>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>true</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>
<artifactSet>
<includes>
<include>org.apache.camel:camel-netty4-http</include>
<include>org.apache.camel:camel-netty4</include>
<include>org.apache.camel:camel-core</include>
<include>io.netty:netty-codec</include>
<include>io.netty:netty-transport</include>
<include>io.netty:netty-buffer</include>
<include>io.netty:netty-common</include>
<include>io.netty:netty-codec-http</include>
<include>io.netty:netty-handler</include>
<include>com.sun.xml.bind:jaxb-impl</include>
<include>com.sun.xml.bind:jaxb-core</include>
<include>commons-pool:commons-pool</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>com.jyates.camel.io.netty</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<netty-camel.version>4.0.27.Final</netty-camel.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-netty4-http</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty-camel.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty-camel.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${netty-camel.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${netty-camel.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>${netty-camel.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${netty-camel.version}</version>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment