You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2022/05/17 06:30:00 UTC
[jira] [Comment Edited] (MBUILDCACHE-21) Caching does not check permissions
[ https://issues.apache.org/jira/browse/MBUILDCACHE-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17537969#comment-17537969 ]
Guillaume Nodet edited comment on MBUILDCACHE-21 at 5/17/22 6:29 AM:
---------------------------------------------------------------------
The solution is to use the following configuration file in {{{}.mvn/maven-build-cache-config.xml{}}}:
{code:xml}
<?xml version="1.0" encoding="UTF-8" ?>
<cache xmlns="http://maven.apache.org/CACHE-CONFIG/1.0.0">
<input>
<plugins>
<plugin groupId="org.apache.maven.plugins" artifactId="maven-surefire-plugin">
<dirScan>
<excludes>
<exclude tagName="java.io.tmpdir"/>
</excludes>
</dirScan>
</plugin>
</plugins>
</input>
</cache>
{code}
However, the error message should contain meaningful and actionnable information.
was (Author: gnt):
The solution is to use the following configuration file in {{.mvn/maven-build-cache-config.xml}}:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8" ?>
<cache xmlns="http://maven.apache.org/CACHE-CONFIG/1.0.0">
<input>
<plugins>
<plugin groupId="org.apache.maven.plugins" artifactId="maven-surefire-plugin">
<dirScan>
<excludes>
<exclude tagName="java.io.tmpdir"/>
</excludes>
</dirScan>
</plugin>
</plugins>
</input>
</cache>
{code}
> 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)