[ https://issues.apache.org/jira/browse/MSHADE-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15828563#comment-15828563 ]
Diego Rivera commented on MSHADE-244: ------------------------------------- Sure. This happens when one uses a configuration similar to the one below: {code} <configuration> <finalName>${project.artifactId}-${project.version}${build.number}-exe</finalName> <createSourcesJar>true</createSourcesJar> <shadedSourcesContent>true</shadedSourcesContent> <createDependencyReducedPom>false</createDependencyReducedPom> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>exe</shadedClassifierName> </configuration> {code} Thus, at some point the plugin will try to copy the produced file onto itself. The patch works regardless by comparing the source and target files in the invocation and if they're the same file, then it skips the copy altogether. > Avoid file copy and replacement when source and target files are the same file > ------------------------------------------------------------------------------ > > Key: MSHADE-244 > URL: https://issues.apache.org/jira/browse/MSHADE-244 > Project: Maven Shade Plugin > Issue Type: Bug > Affects Versions: 2.4.3 > Reporter: Diego Rivera > Priority: Blocker > Attachments: shade.no-replace.patch > > > When Shade::replaceFile() is invoked, and the source and target are the same, > no work should be performed since this can result in an attempt at copying > the same file upon itself, and the target will end up as a 0-byte file. > Instead, the proposed patch (attached) adds a check to perform a best-attempt > intercept of that condition and avoid any unnecessary work. -- This message was sent by Atlassian JIRA (v6.3.4#6332)