Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Maven Shade Plugin

This page provides a space for users to contribute examples, errata, tips and other useful information about the Maven Shade Plugin. Everybody is invited to share his/her thoughts about the plugin to help the community to improve it.

Note: Please do not use this page to report bugs or feature requests. Instead, please fill in an issue in the issue tracking system listed in the official plugin documentation.

Thanks!

– The Maven Team

Examples

Doing this and that:

Code Block
xml
xml
<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>1.3</version>
        <configuration>
           <!-- your example configuration here -->
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

FAQ

How do I prevent duplicate warnings without always performing a mvn clean first?

You need to have maven name the original jar file created during the default jar phase differently than the final output jar created by the shade plugin.

In your pom.xml, do this (note the tmp suffix):

Code Block
xml
xml
...
      <!-- ******************************************************** -->
      <!-- The intermediate JAR file must be named differently than -->
      <!-- the shade output JAR file to prevent duplicate warnings. -->
      <!-- ******************************************************** -->

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <finalName>${artifactId}-${version}-tmp</finalName>
        </configuration>
      </plugin>
...

How do I ...?

You need to ...