sbt/util-cache/src/main
bitloi 840887820c
[2.x] fix: Fix FileAlreadyExistsException in packageDirectory (#9047)
**Problem**
Intermittent java.nio.file.FileAlreadyExistsException when publishing
classes.sbtdir.zip during action-cache packaging under parallel tasks
(#9043). Copying from a temp directory straight into the final path races
on the fixed destination name.

**Solution**
Stage the built zip next to the destination with a unique temp file, then
replace the final path via Files.move with REPLACE_EXISTING and ATOMIC_MOVE,
falling back to a non-atomic move when needed. Add a concurrent
packageDirectory test.

Closes #9043

Generated-by: Cursor (AI-assisted)
2026-04-13 04:30:45 -04:00
..
contraband [2.x] feat: Cache failed compilation to avoid repeated failures (#8490) 2026-01-12 16:03:05 -05:00
contraband-scala/sbt [2.x] feat: Cache failed compilation to avoid repeated failures (#8490) 2026-01-12 16:03:05 -05:00
scala/sbt [2.x] fix: Fix FileAlreadyExistsException in packageDirectory (#9047) 2026-04-13 04:30:45 -04:00