gnodet opened a new pull request, #358:
URL: https://github.com/apache/maven-clean-plugin/pull/358

   ## Motivation
   
   The previous default staging directory for fast clean was
   `${rootDirectory}/target/.clean`, placing it inside a directory that
   may itself be cleaned. This required a 3-step rename-then-move workaround
   in `BackgroundCleaner.fastDelete()` to handle the single-project case.
   
   Maven 4 introduces `.mvn/` as a project-local directory for Maven
   infrastructure (project-local repository, extensions configuration, etc.),
   which is already conventionally excluded from source control. Moving the
   fast-clean staging area to `.mvn/target/.clean` is a better fit:
   
   - **Never inside a `target/` tree**: no risk of a subsequent `clean`
     accidentally deleting the staging area mid-operation.
   - **Maven 4 convention**: Maven infrastructure belongs under `.mvn/`,
     not in build output directories.
   - **Same filesystem guarantee**: `.mvn/` lives at the project root,
     alongside all subproject directories, ensuring the atomic rename used
     by fast clean will succeed.
   
   ## Changes
   
   - `CleanMojo`: default `fastDir` changed from
     `getRootDirectory().resolve("target").resolve(".clean")` to
     `getRootDirectory().resolve(".mvn").resolve("target").resolve(".clean")`
   - `BackgroundCleaner`: updated comments; the 3-step workaround is
     retained for users who explicitly configure a `fastDir` inside a
     directory being cleaned, but no longer needed for the default.
   - IT `fast-delete-default`: description updated to reflect the new default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to