Getting requested versions programatically for all dependency resolution results

I’m working on an extension of the gradle-dependency-lock plugin, to add support for locking transitive dependencies.

We would like to include the requester and its original version requirement for each locked dependency, so we have to get this information somehow all the way down the dependency graph.

I’ve only found an internal API (or at least incubating) for doing this, starting at configurations..incoming.resolutionResult

Would you recommend me using this API, or should I do it in an entirely different way?

‘configuration.incoming.resolutionResult’ is the best API for this, and it’s a public API.