GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Windows AccessDeniedException on install when IDE holds the jar open (Maven 3.10.0 regression) · Issue #2204 · apache/maven-resolver

Windows AccessDeniedException on install when IDE holds the jar open (Maven 3.10.0 regression) #2204

New issue
Copy link
New issue
Copy link
Closed
#2205
Closed
Windows AccessDeniedException on install when IDE holds the jar open (Maven 3.10.0 regression)#2204
#2205
Copy link
Labels
bugSomething isn't working

Description

@gnodet
gnodet
opened on Oct 12, 2026
Issue body actions

Problem

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.

Reported upstream: apache/maven#13329

Root Cause

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

Reacted by SledgeHammer01

Activity

  1. slachiewicz commented on Oct 13, 2026

    @slachiewicz
    slachiewicz
    on Oct 13, 2026
    Member
    More actions

    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.

  2. slachiewicz
    added
    bugSomething isn't working
    on Oct 13, 2026
  3. cstamas
    closed this as completedin #2205on Oct 20, 2026
  4. cstamas
    added a commit that references this issue on Oct 20, 2026

    Fix apache#2204: Windows AccessDeniedException on install when IDE ho…

    This issue will close once commit 80657d3 is merged into the 'master' branch.
    80657d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.