You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Peter De Maeyer (Jira)" <ji...@apache.org> on 2019/12/30 19:18:00 UTC

[jira] [Created] (MSHADE-343) Shaded artifact has no version when finalName is set

Peter De Maeyer created MSHADE-343:
--------------------------------------

             Summary: Shaded artifact has no version when finalName is set
                 Key: MSHADE-343
                 URL: https://issues.apache.org/jira/browse/MSHADE-343
             Project: Maven Shade Plugin
          Issue Type: Bug
    Affects Versions: 3.2.2
            Reporter: Peter De Maeyer


{{ShadeMojo.shadedArtifactFile}} omits the version in the shaded artifact file name when {{finalName}} is set.
That looks like a bug: I think the version should be part of the file name in any case.
I just found this by eyeballing the code, I haven't tried reproducing it with an actual scenario yet.
It only affects situations where {{finalName}} is explicitly set, and it only affects non-main artifacts (test jar, sources and test sources). The main jar artifact doesn't go through this method AFAICT, so is not affected.

{code:java}
        if ( project.getBuild().getFinalName() != null )
        {
            // Shouldn't there be an artifact.getVersion() in the shadedName here too?
            shadedName = project.getBuild().getFinalName() + "-" + classifier + "."
                + artifact.getArtifactHandler().getExtension();
        }
        else
        {
            shadedName = shadedArtifactId + "-" + artifact.getVersion() + "-" + classifier + "."
                + artifact.getArtifactHandler().getExtension();
        }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)