Gradle Module Metadata
Gradle publishes a .module file next to the POM. It describes the component's variants: the files, dependencies, and attributes that belong to each way of consuming the component, such as its API, its runtime, its sources, and its Javadoc.
Artifex reads the file when it arrives and shows what's in it.
What a version page shows
For a version that has a module file, the page shows the following:
- The format version and what produced the file, such as Gradle and its version.
- Each variant, with its name and its attributes, such as
org.gradle.usageandorg.gradle.category. - The files of each variant, with the name, the file it points at, the size, and the SHA-256 digest that the module file declares.
- The dependencies and dependency constraints of each variant, with what each one requires, prefers, or strictly requires, the versions it rejects, and the reason if one was given.
- The capabilities that each variant provides.
- For a variant that lives somewhere else, the coordinates it's available at.
This is the fastest way to answer why a build picked one jar over another: the attributes on the variant are what Gradle matched against.
The file is served exactly as it was deployed, so a build resolves what your publication declared. A .module file that isn't valid Gradle Module Metadata is still stored and served; it just isn't shown as variants.
Fetch variant files early
A module file lists the files of every variant, so a repository that has one already knows which files a build is about to ask for.
Fetch Gradle variant files early on an upstream makes Artifex fetch those files as soon as a module file arrives from it, instead of waiting for a build to ask for each one. A build that then asks for a classifier gets it from the repository right away.
To turn it on, follow these steps:
- Open the repository and go to Upstreams.
- In the upstream's row, click Edit.
- Expand Advanced and turn on Fetch Gradle variant files early.
- Click Save upstream.
It trades storage for latency: every file of every variant is fetched, including sources and Javadoc that your builds might never ask for. A file that the upstream doesn't have is skipped without failing the request that brought the module file in.
The option applies to remote upstreams. Files deployed to the repository are already there, and an Artifex upstream serves its files through without copying them.