[ 
https://issues.apache.org/jira/browse/MRESOURCES-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Todd Dunagan updated MRESOURCES-287:
------------------------------------
    Description: 
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:
{code:java}
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) {code}

  was:
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}
 

 


> 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
>            Priority: Major
>
> 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:
> {code:java}
> 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) {code}



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

Reply via email to