Hiteshsai007 opened a new pull request, #13649: URL: https://github.com/apache/maven/pull/13649
### Description This PR adds project-aware dependency resolution to the Maven 4 API, allowing plugins to resolve their own dependency coordinates while applying the current project's dependency management and repositories. Issue: #10849 **How it works:** I added `DependencyResolver` and `DependencyResolverRequest` overloads that accept both a `Project` and one or more `DependencyCoordinates`. `DefaultDependencyResolver` now uses the project repositories, applies the project's managed version, scope, and exclusions to plugin-supplied direct dependencies when those values are not explicitly configured, and passes the complete managed dependency set to Maven Resolver for transitive dependency management. **Why this is necessary:** Previously, a plugin could resolve either a project's dependencies or its own coordinates, but could not combine the two. Plugins therefore had to duplicate Maven's dependency-management lookup and merge logic, as demonstrated by MCOMPILER-391. This change centralizes that behavior in Maven's resolver service while preserving values explicitly supplied by the plugin. **Testing:** - Added API coverage verifying that project context and plugin-supplied coordinates are carried together in `DependencyResolverRequest`. - Added resolver tests covering managed version, scope, and exclusions, plus precedence for explicitly configured values. - Successfully ran `mvn -pl impl/maven-impl -am -DskipITs -Drat.skip=true test` with Java 26: all 19 reactor modules passed; `maven-impl` ran 750 tests with 0 failures and 4 skipped. - Formatting and Checkstyle passed through the Maven build. - Core IT was not run. --- Following this checklist to help us incorporate your contribution quickly and easily: - [x] This pull request addresses one issue without pulling in unrelated changes. - [x] The pull request description explains what the change does, how, and why. - [x] The commit has a meaningful subject line and body. - [x] Unit tests cover the behavioral change. - [ ] Full `mvn verify` has been run. - [ ] The Core IT suite has been run. - [ ] 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]
