[ 
https://issues.apache.org/jira/browse/MSHARED-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17571761#comment-17571761
 ] 

Konrad Windszus commented on MSHARED-1112:
------------------------------------------

I am pretty sure that {{Files::setPosixFilePermissions(...)}} applied to a 
symbolic link sets the file permissions on the symlink target file which is not 
intended here. Also the permissions which are set are those of the source 
symlink's target in 
https://github.com/apache/maven-shared-utils/blob/28c8ce627255a69b59aa7b3e6f794b7f5a872ea8/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java#L2017,
 due to {{Files::getPosixFilePermissions(...)}} follows symlinks by default.
Also I don't think that every file system supports permissions on symlinks 
themselves.

> Copy symlinks failed - NoSuchFileException
> ------------------------------------------
>
>                 Key: MSHARED-1112
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1112
>             Project: Maven Shared Components
>          Issue Type: Bug
>          Components: maven-filtering
>    Affects Versions: maven-filtering-3.2.0, maven-filtering-3.3.0
>            Reporter: Slawomir Jaranowski
>            Priority: Major
>
> Tested on maven-shared-utils
> h4. m-resource-p 3.2.0 -> m-filtering 3.2.0, m-resource-p 3.3.0 -> 
> m-filtering 3.3.0
> {code:java}
> Caused by: java.nio.file.NoSuchFileException: 
> .../maven-shared-utils/target/test-classes/symlinks/src/symX
>     at sun.nio.fs.UnixException.translateToIOException (UnixException.java:86)
>     at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:102)
>     at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:107)
>     at sun.nio.fs.UnixFileAttributeViews$Posix.setMode 
> (UnixFileAttributeViews.java:238)
>     at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions 
> (UnixFileAttributeViews.java:260)
>     at java.nio.file.Files.setPosixFilePermissions (Files.java:2045)
>     at org.apache.maven.shared.filtering.FilteringUtils.copyFilePermissions 
> (FilteringUtils.java:477)
>     at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:457)
>     at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:110)
>     at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:277)
>     at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:356)
> ...
> {code}
> h4. m-resource-p 3.1.0 -> m-filtering 3.1.1
> build ok



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to