arturobernalg opened a new pull request, #13485:
URL: https://github.com/apache/maven/pull/13485

   Addresses #13151
   
   ### What and why
   
   `Node` gives no access to the metadata the Resolver keeps on the dependency 
node, so tools such as Pilot reach it by reflection. This adds four accessors, 
following the noun-style convention of #13036:
   
   - `Optional<Node> winner()`
   - `Optional<String> premanagedVersion()`
   - `Optional<String> premanagedScope()`
   - `Optional<String> originalScope()`
   
   ### How
   
   `DefaultNode` reads the values from the node data 
(`ConflictResolver.NODE_DATA_WINNER`, `NODE_DATA_ORIGINAL_SCOPE`) and 
`DependencyManagerUtils`, the same sources `asString()` already uses. 
`WrapperNode` delegates, so the metadata survives `filter()`. No Resolver type 
is added to `maven-api-core`. The values are only present when the graph was 
collected in verbose mode, which the Javadoc says. They are empty otherwise.
   
   The verbose configuration constant mentioned in the issue is not part of 
this change, because its placement is still open.
   
   ### Tests
   
   `DefaultNodeTest` has 7 new tests (11 in total, run three times). Winner and 
original scope go through the real Resolver conflict resolution chain in 
verbose mode, and the rest check the managed values, the empty case and 
`filter()`. The new tests do not compile on master, since the accessors do not 
exist there. `maven-api-core` and `maven-impl` pass (778 tests in `maven-impl`) 
and spotless is clean. I did not run the integration tests.
   
   `Node` is a `@Provider` interface and its only implementers in the 
repository are `DefaultNode` and `WrapperNode`. External implementors would 
have to add the methods, as with `repository()`. This targets master (4.1.0) 
only.
   
   ---
   
   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:
   
   - [ ] 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]

Reply via email to