You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Todd Dunagan (Jira)" <ji...@apache.org> on 2022/06/09 17:17:00 UTC

[jira] [Created] (MRESOURCES-287) Symlink resource copy fails if symlink target does not exist.

Todd Dunagan created MRESOURCES-287:
---------------------------------------

             Summary: Symlink resource copy fails if symlink target does not exist.
                 Key: MRESOURCES-287
                 URL: https://issues.apache.org/jira/browse/MRESOURCES-287
             Project: Maven Resources Plugin
          Issue Type: Bug
          Components: copy
    Affects Versions: 3.2.0
            Reporter: Todd Dunagan


This problem occurs when symlink file resources are copied in such an order whereby the symlink file is attempted to be copied prior to the related target file being copied. The root cause appears to be a change in MRP 3.2.0 where it attempts to set permissions on the symlink (and thus the target file) and this fails. I believe this is related to a change introduced as part of a bug fix in in the MRP 3.2.0 release: MRESOURCES-236.

An example stack track trace excerpt as the issue is encountered as the symlink file is being copied to its destination and the symlink's target file is not yet in place:

 
{noformat}
Caused by: java.nio.file.NoSuchFileException: [full path to file name]     at sun.nio.fs.UnixException.translateToIOException (UnixException.java:92)     at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)     at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:116)     at sun.nio.fs.UnixFileAttributeViews$Posix.setMode (UnixFileAttributeViews.java:254)     at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions (UnixFileAttributeViews.java:276)     at java.nio.file.Files.setPosixFilePermissions (Files.java:2080)     at org.apache.maven.shared.utils.io.FileUtils.copyFilePermissions (FileUtils.java:1997)     at org.apache.maven.shared.utils.io.FileUtils.copyFile (FileUtils.java:1978)     at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile (DefaultMavenFileFilter.java:106)     at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources (DefaultMavenResourcesFiltering.java:262)     at org.apache.maven.plugins.resources.ResourcesMojo.execute (ResourcesMojo.java:356){noformat}
 

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)