ayush-builds-stuff opened a new pull request, #14133: URL: https://github.com/apache/maven/pull/14133
Contributes to #13461. Related to #13467. ## Summary This is the first incremental project-state foundation for the Project Builder inversion described in #13461. - Make `DefaultProject` an immutable snapshot instead of a live wrapper around `MavenProject`. - Add the internal `MutableProject` holder backed by `AtomicReference<Project>`. - Preserve stable project identity while replacing snapshots after project mutations. - Preserve distinct identity for projects with identical GAVs and for forked projects. - Replace direct `DefaultProject` to `MavenProject` access with an internal compatibility bridge. - Add compatibility characterization and regression tests. The v3 project builder remains unchanged in this PR. Moving the builder logic into `maven-impl` will be handled in later incremental PRs. ## Mapping design Each `DefaultProject` snapshot retains an internal association with its stable `MutableProject` holder. `DefaultSession` maintains identity-based mappings between the exact `MavenProject` instance and that holder. The registry is shared by derived session views, so `withContext()`, repository derivation, and similar operations do not lose project identity. `DefaultProjectManager` updates the existing legacy state during this transitional phase and then atomically replaces the holder's current snapshot. This avoids GAV-based lookup collisions, preserves forked-project identity, and keeps `MutableProject` out of the public API. ## Validation - `maven-core`: 938 tests, 0 failures, 0 errors, 1 skipped - `maven-impl`: 960 tests, 0 failures, 0 errors, 4 skipped - Maven CLI and legacy embedder reactor compilation succeeded - Checkstyle passed - Spotless passed - `git diff --check` passed --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [x] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- 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]
