Open Vampire opened 2 years ago
ArtifactResolutionQuery
is on its way out, it is not variant aware and will be replaced by a proper solution. It is no longer part of the dependency management documentation for a while. As such, this will most likely never be fixed before it disappears for good.
Ah, I see. Is there already some replacement to be used instead?
Unfortunately no, if there was, it would be actively deprecated
The example usage in the JavaDoc of
ArtifactResolutionQuery
(https://docs.gradle.org/7.3.1/javadoc/org/gradle/api/artifacts/query/ArtifactResolutionQuery.html) is a bit unlucky if you are not using Groovy, because it depends on Groovy duck-typing.In a statically typed language like Java or Kotlin,
it.selected
andit.file
will not work without a down-cast toResolvedDependencyResult
andResolvedArtifactResult
respectively.Maybe there is some typed API missing to make this possible cleaner in statically typed languages, or at least there should be an example added in Java or Kotlin where you see to what you actually have to down-cast.