Maven - Shading

Card Puncher Data Processing

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>





Discover More
Java Conceptuel Diagram
Java - (Jar|Java ARchive) File

JAR stands for Java ARchive and is file format born in 1996 as a simple extension of the popular ZIP archive format with class and other required resource files: manifest signature files images,...
Card Puncher Data Processing
Maven - Assembly (Plugin)

The assembly plugin will build assembly. An “assembly” is a group of files, directories, and dependencies that are assembled into an archive format and distributed. The plugin goals documentation...



Share this page:
Follow us:
Task Runner