[GRADLE-3348] Error during subsequent builds when unpacking an archive containing read-only files Created: 13/Oct/15  Updated: 02/Nov/15  Resolved: 02/Nov/15

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Mark Vieira (Inactive) Assignee: Lari Hotari
Resolution: Duplicate Votes: 0

Issue Links:
Duplicate
Duplicates GRADLE-2959 zipTree unable to overwrite temporary... Resolved

 Description   

This issue was initially reported on the forums: https://discuss.gradle.org/t/incremental-zip-unpacking/12109

When unpacking an archive containing a read-only file subsequent invocations of the task fail due to Gradle attempting to overwrite the existing file in the temporary expanded directory.

$ gradle copy
:copy

FAILURE: Build failed with an exception.

* What went wrong:
Could not expand ZIP '/Users/mark/Desktop/gradle/test.zip'.
> Could not copy zip entry /Users/mark/Desktop/gradle/test.zip!test.txt to '/Users/mark/Desktop/gradle/build/tmp/expandedArchives/test.zip_4dcxfx6r85atpxpbc9dwrttyb/test.txt'.

Generated at Wed Jun 30 12:46:27 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.