gnodet commented on issue #7682: URL: https://github.com/apache/maven/issues/7682#issuecomment-6275476011
Closing this issue. The root cause is architectural in Maven 3's dependency resolution model: `MojoExecutor` unions all mojos' scopes into a single set, resolves one dependency graph, and stores it on the shared mutable `MavenProject`. As cstamas noted above, the collected graph for compile scope is NOT a subgraph of the graph for test scope — they are fundamentally different graphs. This can't be cleanly fixed while preserving the `MavenProject.getArtifacts()` / `setResolvedArtifacts()` single-graph contract that Maven 3-style plugins depend on. **This is solved for Maven 4 plugins.** With `@Resolution(pathScope = "main-compile")`, each mojo field gets its own independent `DependencyResolverResult` — separate graph collection, proper scope mediation via `ResolutionScope`, cached per `(project, pathScope)`, no shared mutable state. The clean migration path is for plugins to adopt the Maven 4 API. See the comment on #13400 for the full technical analysis. _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]
