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 20:17:00 UTC
[jira] [Commented] (MSHADE-343) Shaded artifact has no version when
finalName is set
[ https://issues.apache.org/jira/browse/MSHADE-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005805#comment-17005805 ]
Peter De Maeyer commented on MSHADE-343:
----------------------------------------
I jumped the gun on this one, this is not a bug.
{{finalName}} already includes the version, so that's why it's not attached.
Also, {{finalName}} in the code doesn't correspond to the {{<finalName>}} parameter in the plugin configuration.
Not sure how exactly that fits together, but it's clear I was too quick here.
You can close this as not a bug.
> 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
> Priority: Minor
>
> {{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 {{shadedName}} 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 shaded jar artifact doesn't go through this code path AFAICT, so is not affected.
> {code:java}
> if ( project.getBuild().getFinalName() != null )
> {
> // Shouldn't artifact.getVersion() be part of 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)