Maven Shade Plugin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 10: Line 10:


This plugin provides the capability to package the artifact in an uber-jar, including its dependencies and to ''shade'' - i.e. rename - the packages of some of the dependencies.
This plugin provides the capability to package the artifact in an uber-jar, including its dependencies and to ''shade'' - i.e. rename - the packages of some of the dependencies.
=Example=
This example shows how to create a [[Jmh|jmh]] uber-jar:


<syntaxhighlight lang='xml'>
<syntaxhighlight lang='xml'>

Latest revision as of 20:05, 6 April 2018

External

Internal

Overview

This plugin provides the capability to package the artifact in an uber-jar, including its dependencies and to shade - i.e. rename - the packages of some of the dependencies.

Example

This example shows how to create a jmh uber-jar:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.1.1</version>
    <executions>
        <execution>
            <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                     <finalName>benchmarks</finalName>
                         <transformers>
                              <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                 <mainClass>org.openjdk.jmh.Main</mainClass>
                              </transformer>
                         </transformers>
                </configuration>
       </execution>
  </executions>
</plugin>