Usage

Creating a Shaded JAR

The goals for the Shade Plugin are bound to the package phase in the build lifecycle.

mvn package

Configuring Your Shade Plugin

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <!-- put your configurations here -->
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

Resource Transformers

Transformers in org.apache.maven.plugins.shade.resource
ApacheLicenseResourceTransformerPrevents license duplication
ApacheNoticeResourceTransformerPrepares merged NOTICE
AppendingTransformerAdds content to a resource
ComponentsXmlResourceTransformerAggregates Plexus components.xml
DontIncludeResourceTransformerPrevents inclusion of matching resources
IncludeResourceTransformerAdds files from the project
ManifestResourceTransformerSets entries in the MANIFEST
ServicesResourceTransformerMerges META-INF/services resources
XmlAppendingTransformerAdds XML content to an XML resource

For more information, see samples.