Attaching the Shaded Artifact

By default, the plugin will replace the project's main artifact with the shaded artifact. If both the original and the shaded artifact should be installed/deployed to the repository, one can configure the plugin to attach the shaded artifact as a secondary artifact:

  1. <project>
  2. ...
  3. <build>
  4. <plugins>
  5. <plugin>
  6. <groupId>org.apache.maven.plugins</groupId>
  7. <artifactId>maven-shade-plugin</artifactId>
  8. <version>3.0.0</version>
  9. <executions>
  10. <execution>
  11. <phase>package</phase>
  12. <goals>
  13. <goal>shade</goal>
  14. </goals>
  15. <configuration>
  16. <shadedArtifactAttached>true</shadedArtifactAttached>
  17. <shadedClassifierName>jackofall</shadedClassifierName> <!-- Any name that makes sense -->
  18. </configuration>
  19. </execution>
  20. </executions>
  21. </plugin>
  22. </plugins>
  23. </build>
  24. ...
  25. </project>

The shaded artifact is distinguished from the main artifact by means of the additional classifier.