I need to fetch all artifacts and variants of all dependencies of my project. For example if I have a Java library as dependency, I must fetch its Jar, sources and javadoc. To do this, I am using the Artifact View API and it works, but I have a lot of different dependencies, which can contain jar, zip or other custom artifacts, so I have to define Artifact Views for all types of dependencies. It makes the code more complex to maintain, so I would like to simplify it.
Is there an alternative option to Artifact View, does Gradle provides an API allowing to fetch all artifacts and variants of a dependency?
So no, I don’t think there is some programmatic way to list all variants.
Additionally, for non-GMM publications there are some variants derived out of thin air, for GMM you could look into the GMM.
But either way, there could also always be additional artifacts with classifiers that are not modeled as proper feature variant artifacts in the GMM so even if there were a way to list all variants you would miss those.