[ https://issues.apache.org/jira/browse/MBUILDCACHE-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17537998#comment-17537998 ]
Guillaume Nodet commented on MBUILDCACHE-21: -------------------------------------------- Yes, I agree we should avoid checking directories that are not accessible, in a similar way that we already exclude by default hidden directories and files. However, those directories seem very specific and I'm not sure we can check the problem with permissions before actually listing the directory: {code} ➜ mbuildcache-21 git:(MBUILDCACHE-20) ✗ ll /var/folders/8c/60048nhx4sz7p2d9921fjd000000gn/T/com.apple.avconferenced/ total 0 drwx------@ 2 gnodet staff 64B Apr 28 08:47 TemporaryItems ➜ mbuildcache-21 git:(MBUILDCACHE-20) ✗ ll /var/folders/8c/60048nhx4sz7p2d9921fjd000000gn/T/com.apple.avconferenced/TemporaryItems total 0 ls: /var/folders/8c/60048nhx4sz7p2d9921fjd000000gn/T/com.apple.avconferenced/TemporaryItems: Operation not permitted ➜ mbuildcache-21 git:(MBUILDCACHE-20) ✗ {code} I'll dig a bit more, but I'm not sure it would be a good idea to simply drop {{IOException}} occurring during the check. Another possibility would be to somehow change the _default_ config to exclude the {{java.io.tmpdir}} folder. > Caching does not check permissions > ---------------------------------- > > Key: MBUILDCACHE-21 > URL: https://issues.apache.org/jira/browse/MBUILDCACHE-21 > Project: Maven Build Cache Extension > Issue Type: Bug > Reporter: Mark Dodgson > Priority: Major > > Below is a minimal pom.xml file the illustrates the problem. > Specifying a surefire systemPropertyVariable for `java.io.tmpdir` to the temp > folder produces an `AccessDeniedException` > > *example pom.xml* > > {code:java} > <?xml version="1.0" encoding="UTF-8"?> > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>org.example</groupId> > <artifactId>build_cache_test</artifactId> > <version>1.0-SNAPSHOT</version> > <properties> > <maven.compiler.source>17</maven.compiler.source> > <maven.compiler.target>17</maven.compiler.target> > </properties> > <build> > <extensions> > <extension> > <groupId>org.apache.maven.extensions</groupId> > <artifactId>maven-build-cache-extension</artifactId> > <version>1.0.0-SNAPSHOT</version> > </extension> > </extensions> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-surefire-plugin</artifactId> > <version>3.0.0-M5</version> > <configuration> > <systemPropertyVariables> > <java.awt.headless>true</java.awt.headless> > <java.io.tmpdir>${java.io.tmpdir}</java.io.tmpdir> > </systemPropertyVariables> > </configuration> > </plugin> > </plugins> > </build> > </project> {code} > > > *Output* > {code:java} > [INFO] Using XX hash algorithm for cache > [INFO] Attempting to restore project from build cache > [INFO] Going to calculate checksum for project [groupId=org.example, > artifactId=build_cache_test] > [INFO] Scanning plugins configurations to find input files. Probing is > enabled, values will be checked for presence in file system > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD FAILURE > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 0.246 s > [INFO] Finished at: 2022-05-17T06:13:08+01:00 > [INFO] > ------------------------------------------------------------------------ > [ERROR] Failed to calculate checksums for build_cache_test: > java.nio.file.AccessDeniedException: /tmp/tracker-extract-3-files.111 {code} > > -- This message was sent by Atlassian Jira (v8.20.7#820007)