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

Konrad Windszus edited comment on MSHARED-1112 at 7/26/22 5:21 PM:
-------------------------------------------------------------------

I had a quick look and this seems to be another issue, as in the file of this 
symlink the *lastModified* date is *not* the issue and the symlink is correctly 
copied/created. The problem is rather within 
{{FileUtils.copyFilePermissions()}} (called in 
https://github.com/apache/maven-shared-utils/blob/873ebb0e3c718d3dc2ceb095f8cb99a89faa7918/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java#L1996)
 which fails as it tries to set the permissions on the non-existing symlink 
destination. This method should IMHO just be skipped for symbolic links. So 
although this is a similar stacktrace as observed with MSHARED-1107 it is in 
fact a different issue. 

In general setting permissions on symlinks is not supported (compare also with 
https://superuser.com/a/303063).


was (Author: kwin):
I had a quick look and this seems to be another issue, as in the file of this 
symlink the *lastModified* date is *not* the issue and the symlink is correctly 
copied/created. The problem is rather within 
{{FileUtils.copyFilePermissions()}} (called in 
https://github.com/apache/maven-shared-utils/blob/873ebb0e3c718d3dc2ceb095f8cb99a89faa7918/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java#L1996)
 which should IMHO just be skipped for symbolic links. So although this is a 
similar stacktrace as observed with MSHARED-1107 it is in fact a different 
issue. In general setting permissions on symlinks is not supported (compare 
also with https://superuser.com/a/303063).

> 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