Gradle downloads `maven-metadata.xml` for dependen...
# community-support
a
Gradle downloads
maven-metadata.xml
for dependencies. Is there a way to access this file through the Gradle API? Or are its contents surfaced through the API in some way? I want to view all available versions of a dependency. I could download the file manually, but I want it be cached (with an expiry) and available offline. It'd also be nice (but not strictly required) to support getting the available versions from all available repositories.
v
Not that I know of. The
gradle-versions-plugin
by Ben Manes for example copies the configurations, replaces the versions with "use latest version" and then resolves to get the latest version to report as update. The
refreshVersions
plugin by Splitties that wants to add all newer versions as comments to the appropriate files afair manually downloads the
maven-metadata.xml
files to get to that information, which of course then only works for Maven repositories. If you want to use Gradle means to get the file and have it cached, you can probably define an Ivy repository with proper pattern set and the version declared to be "changing", so that after the "changing cache period" is expired the file is re-fetched but in the meantime or when offline the cached file is used.