[ https://issues.apache.org/jira/browse/MSHADE-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter De Maeyer updated MSHADE-343: ----------------------------------- Description: {{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 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} was: {{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} > 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 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 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)