You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows AccessDeniedException on install when IDE holds the jar open (Maven 3.10.0 regression) #2204
Maven 3.10.0 introduced a regression on Windows where mvn install fails with java.nio.file.AccessDeniedException when an IDE (e.g. IntelliJ IDEA) has the target artifact .jar open.
Resolver PR #2083 (commit a7104fab) replaced the old stream-based file copy with Files.move() + ATOMIC_MOVE in PathProcessorSupport.retryingMove() to fix the f007 security finding (non-atomic Windows publication).
The old code used classicCopy()\ which opens the target with a truncating FileOutputStream. On Windows, this succeeds even when another process has the file open for reading, because the stream open uses FILE_SHARE_READ` semantics.
The new code uses Files.move() which maps to MoveFileEx/ReplaceFile on Windows. These system calls require exclusive access to the destination — any open handle (including a shared read-only handle from an IDE) causes AccessDeniedException. With only 5 retries at 50 ms each, persistent IDE locks are never released.
Fix
After exhausting all WINDOWS_MOVE_ATTEMPTS with AccessDeniedException, fall back to classicCopy() directly to the target as a last resort. A system property controls the fallback.
Reported and analyzed by Hermès Agent on behalf of Guillaume Nodet
Another trigger for the same move failure, from CI rather than an IDE: two parallel invoker ITs sharing one local repository on windows-latest. One IT process has plexus-utils-3.6.0.jar loaded in its plugin class loader while the other moves plexus-utils-3.6.0.jar.<n>.tmp over it, and the build fails with AccessDeniedException ("Could not transfer artifact org.codehaus.plexus:plexus-utils:jar:3.6.0 ... .tmp -> ...plexus-utils-3.6.0.jar"). It happens with Maven 3.10.0 (resolver 2.0.24) and 4.0.0-rc-7 (resolver 2.0.23), with FileLockNamedLockFactory active, and not with 3.9.x. Four of the last mojohaus/build-helper-maven-plugin master runs failed this way, for example https://github.com/mojohaus/build-helper-maven-plugin/actions/runs/38377940557. The fallback in #2205 should cover it.
Activity
slachiewicz commentedon Oct 13, 2026
Another trigger for the same move failure, from CI rather than an IDE: two parallel invoker ITs sharing one local repository on
windows-latest. One IT process hasplexus-utils-3.6.0.jarloaded in its plugin class loader while the other movesplexus-utils-3.6.0.jar.<n>.tmpover it, and the build fails withAccessDeniedException("Could not transfer artifact org.codehaus.plexus:plexus-utils:jar:3.6.0 ... .tmp -> ...plexus-utils-3.6.0.jar"). It happens with Maven 3.10.0 (resolver 2.0.24) and 4.0.0-rc-7 (resolver 2.0.23), withFileLockNamedLockFactoryactive, and not with 3.9.x. Four of the last mojohaus/build-helper-maven-plugin master runs failed this way, for example https://github.com/mojohaus/build-helper-maven-plugin/actions/runs/38377940557. The fallback in #2205 should cover it.