NO shaded jar found in target after maven shade plugin packages the project

On running mvn package:shade shade, the log has entry which says:Replacing XYZ.jar with XYZ-shaded.jar but in my target directory, I cannot find shaded jar enter image description here

This is my pom regarding maven shade

enter image description here

2 answers

  • answered 2018-04-17 05:34 Patrick

    Have your checked whether the output jar file is the shaded one?

    The Shade plugin is probably replacing the original file here, meaning overwriting it with the shaded version.

    If you wish to get both jar files (shaded and unshaded) at the end, you probably need to set the shadedArtifactAttached property to true:

    Defines whether the shaded artifact should be attached as classifier to the original artifact. If false, the shaded jar will be the main artifact of the project

    See Maven Shade Mojo Documentation.

  • answered 2018-04-17 05:34 Roma Jain

    This is updated pom on which mvn package creates a shaded jar enter image description here