Table of Contents

About

Shading is performed by the Apache Maven Shade plugin.

Shading = Relocation of the class to avoid a JAR hell

Shading i.e. rename - the packages of some of the dependencies.

Example

Jackson library

See example for the Jackson library: Parquet/parquet-mr/tree/master/parquet-jackson

Runnable Jar

The shade plugin permits to create a Java - Jar (Startable|Runnable|Executable)

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-shade-plugin</artifactId>
	<version>2.4.3</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>shade</goal>
			</goals>
			<configuration>
				<transformers>
					<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
						<mainClass>myPackage.myMain</mainClass>
					</transformer>
				</transformers>
			</configuration>
		</execution>
	</executions>
</plugin>