You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "James Nord (Jira)" <ji...@apache.org> on 2022/10/25 11:24:00 UTC
[jira] [Comment Edited] (MSHARED-1153) FilteringUtils makes incorrect assumption about filesystem
[ https://issues.apache.org/jira/browse/MSHARED-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623764#comment-17623764 ]
James Nord edited comment on MSHARED-1153 at 10/25/22 11:23 AM:
----------------------------------------------------------------
THanks for the links, however docker was already mounting with the metadata option for the volume mount
{noformat}
drvfs on /home/ath-user/code type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=0;gid=0;metadata;symlinkroot=/mnt/host/,mmap,access=client,msize=262144,trans=virtio){noformat}
{noformat}
[ath-user@4d2bd302cb3f test]$ pwd
/home/ath-user/code/target/test
[ath-user@4d2bd302cb3f test]$ echo hello > test.txt
[ath-user@4d2bd302cb3f test]$ ls -la test.txt
-rw-rw-r-- 1 ath-user ath-user 6 Oct 25 11:21 test.txt
[ath-user@4d2bd302cb3f test]$ chmod go= test.txt
[ath-user@4d2bd302cb3f test]$ ls -la test.txt
-rw------- 1 ath-user ath-user 6 Oct 25 11:21 test.txt
[ath-user@4d2bd302cb3f test]$
{noformat}
was (Author: jnord_cbs):
docker was already mounting with the metadata option for the volume mount
{noformat}
drvfs on /home/ath-user/code type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=0;gid=0;metadata;symlinkroot=/mnt/host/,mmap,access=client,msize=262144,trans=virtio)
{noformat}
> FilteringUtils makes incorrect assumption about filesystem
> ----------------------------------------------------------
>
> Key: MSHARED-1153
> URL: https://issues.apache.org/jira/browse/MSHARED-1153
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-filtering
> Reporter: James Nord
> Priority: Blocker
>
> when copying files using filtering during a project build the build can fail with the following exception due to an incorrect assumption in [FilteringUtils.java#L474-L489|https://github.com/apache/maven-filtering/blob/456b03a9510f1e64e457f393a4e04cbeeebd9538/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java#L474-L489]
> The filesystem in use may present a posix view (ie it is a mounted filesystem) but itself may not support setting posix attributes.
> This is common when using docker on windows and mounting windows directory into the contain.
> this then causes the following exception :
> {noformat}
> Caused by: org.apache.maven.shared.filtering.MavenFilteringException: copying /home/ath-user/code/src/main/resources/ath-container/Dockerfile to /home/ath-user/code/target/classes/ath-container/Dockerfile failed with FileSystemException: /home/ath-user/code/target/classes/ath-container/Dockerfile: Operation not permitted
> at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile (DefaultMavenFileFilter.java:118)
> at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources (DefaultMavenResourcesFiltering.java:277)
> at org.apache.maven.plugins.resources.ResourcesMojo.execute (ResourcesMojo.java:356)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
> at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke (Method.java:566)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
> Caused by: java.nio.file.FileSystemException: /home/ath-user/code/target/classes/ath-container/Dockerfile: Operation not permitted
> at sun.nio.fs.UnixException.translateToIOException (UnixException.java:100)
> 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.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)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
> at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke (Method.java:566)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
> {noformat}
> Given the code ignores setting attributes if it can not due to an UnsupportedOperation (e.g. the filesystem is not even posix capable) it should do the same (for the FileFileSystemException)
>
> java 11.0.16.1 / WIndows 11 / Docker Desktop 4.8.2 (79419).
> Maven 3.8.6 / maven-resources-plugin 3.3.0
--
This message was sent by Atlassian Jira
(v8.20.10#820010)