Maven Shade Plugin: Difference between revisions

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


<syntaxhighlight lang='xml'>
<syntaxhighlight lang='xml'>
<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>
</syntaxhighlight>
</syntaxhighlight>

Revision as of 20:04, 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.

<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>