seregamorph opened a new issue, #12646:
URL: https://github.com/apache/maven/issues/12646

   ### Affected version
   
   4.0.0-rc-6
   
   ### Bug description
   
   Maven 4 creates `target/project-local-repo` under the root project 
directory, which contains built JAR artifacts and there is a preference to use 
them in case of module subset builds.
   The directory location assumes that the root project is also a root parent 
for other modules and if it's not, there is a race condition to clean this 
directory.
   
   How to reproduce the problem:
   * root `pom.xml` should have a parent, let's call it `super-pom/pom.xml`
   * the `super-pom/pom.xml` should have other direct child modules, which do 
not inherit root `pom.xml`
   * build the multi-module project as a parallel build, like `./mvnw clean 
verify`
   * the `MultiThreadedBuilder` will schedule `super-pom/pom.xml` as a first 
project to build in the reactor, it finishes alone
   * then, in parallel it starts building root `pom.xml` and other modules 
which define `super-pom` as direct parent
   * maven-clean-plugin of root pom.xml iterates files for removal
   * at the same time(!) other modules start adding file under 
`$projectRoot/target/project-local-repo`
   * maven-clean-plugin rechecks that `target` is empty and fails:
   ```
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-clean-plugin:3.5.0:clean (default-clean) on 
project pt: Failed to clean project: Failed to delete 
/Users/..../server/target/project-local-repo -> [Help 1]
   [ERROR] 
   ```
   (the root project is called `pt`). See 
[timeline](https://github.com/maven-turbo-reactor/maven-timeline-extension) 
diagram that demonstrates this (`pt-clean` is long and executed in parallel):
   
   <img width="1479" height="333" alt="Image" 
src="https://github.com/user-attachments/assets/0c0b96fe-774e-489c-af18-68d0fcc2b3dd";
 />
   
   This is a 100% reproducible for a project with the big number of modules.


-- 
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