gnodet opened a new issue, #13461: URL: https://github.com/apache/maven/issues/13461
Part of #13460 — Migrate Maven internals from v3 to v4 API ## Context Currently the v4 `ProjectBuilder` service (`api/maven-api-services/.../ProjectBuilder.java`) is implemented by a thin wrapper in `maven-core/.../internal/impl/DefaultProjectBuilder` (~232 lines) that **delegates back to the v3** `DefaultProjectBuilder` (`maven-core/.../project/DefaultProjectBuilder`, ~1420 lines). The delegation arrow is backwards. The v3 project builder already delegates to the v4 `ModelBuilder` internally (which was migrated in a previous effort), so the hardest sub-problem (model building) is solved. ## Goal Invert the delegation so the real project-building logic lives in `impl/maven-impl` using v4 types natively, and the v3 project builder in `maven-core` (or `compat/`) becomes a thin wrapper. ## Key files - **v4 API**: `api/maven-api-services/.../services/ProjectBuilder.java` - **v4 wrapper (currently delegates to v3)**: `impl/maven-core/.../internal/impl/DefaultProjectBuilder.java` - **v3 implementation (real logic)**: `impl/maven-core/.../project/DefaultProjectBuilder.java` - **v4 Project**: `impl/maven-core/.../internal/impl/DefaultProject.java` (currently wraps `MavenProject`) - **v3 MavenProject**: `compat/maven-compat` or `impl/maven-core/.../project/MavenProject.java` ## Approach 1. Create `DefaultProjectBuilder` in `impl/maven-impl` implementing `o.a.m.api.services.ProjectBuilder` 2. Work with v4 `Project`, `Session`, `Model` types natively 3. The v3 `DefaultProjectBuilder` becomes a thin wrapper that delegates to the v4 builder and wraps results as `MavenProject` 4. `DefaultProject` (v4) should hold v4 types natively instead of wrapping `MavenProject` 5. Related classes to consider: `ProjectBuildingHelper`, `ProjectDependenciesResolver`, collection strategies ## Compatibility `MavenProject` stays available for plugins — it becomes a wrapper around v4 `Project` instead of the source of truth. ## Dependencies - None (model builder is already v4-native) ## Complexity Medium-high. ~1400 lines of logic to restructure. _Claude Code on behalf of Guillaume Nodet_ -- 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]
