gnodet commented on issue #12646: URL: https://github.com/apache/maven/issues/12646#issuecomment-5146227346
The `project-local-repo` was introduced in [MNG-7629](https://github.com/apache/maven/pull/912) to solve several problems that direct `moduleDir/target/` resolution can't handle: - **Subtree/partial builds**: `mvn -pl :child-2` doesn't have `child-1` in the reactor — `project-local-repo` makes its artifacts available without installing to `~/.m2/repository` - **Attached and classified artifacts**: the direct `target/` fallback only resolves `target/classes` — it can't find `sources.jar`, `javadoc.jar`, test-jars, or any classified artifact. `project-local-repo` stores them all in repository layout. - **Consumer POMs**: `project-local-repo` stores both build and consumer POM variants - **Resumable builds**: `mvn install -rf :module-C` resolves modules A and B from the previous successful run Your `LocalReactorWorkspaceReader` approach works well for the main JAR case, but the cases above are why the full repository-layout copy is needed. Regarding the proposal to move to `.mvn/project-local-repo` — this addresses the race condition by taking it out of `target/` entirely, so `maven-clean-plugin` can't interfere. `ReactorReader` would then fully own its lifecycle (creation, cleanup, and resolution). -- 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]
