Thu, 29 Feb 2024, /Tamás Cservenák/:

am not Windows user, but we had several reports about issues, like this one:
https://issues.apache.org/jira/browse/MRESOLVER-372

I see.  Thank you for the reference.

As far as I'm aware, such "access denied" exceptions on Windows are not specific to atomic moves. It could happen one process has opened a file for reading, preventing another from overwriting it immediately. I guess such updates need a retry mechanism, at least for the atomic move part.


On Thu, Feb 29, 2024 at 1:40 PM Stanimir Stamenkov wrote:
Thu, 29 Feb 2024, /Tamás Cservenák/:

Resolver 1.9.18 uses the temp file technique you describe:
copies to (random) temp file located in the same directory where target file is, and then atomically moves the file to its place
(unless OS is windows, for obvious reasons).

Doesn't atomic file move/replace work on Windows? I'm using Files.move() [1] with ATOMIC_MOVE [2] option to achieve the same technique on Windows successfully.

[1] 
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#move(java.nio.file.Path,java.nio.file.Path,java.nio.file.CopyOption..
.)
[2] 
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/StandardCopyOption.html#ATOMIC_MOVE

--

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to