Gradle Module Metadata
Gradle Module Metadata (.module) describes a component's variants. It records the files, dependencies, and attributes for each way of consuming the component, such as its API, runtime, sources, and Javadoc variants.
Artifex parses the .module file when it's deployed or fetched and shows its contents.
What a version page shows
For a version that has a .module file, the page shows the following:
- The format version and the tool that produced the file, such as Gradle and its version.
- Each variant, with its name and attributes, such as
org.gradle.usageandorg.gradle.category. - The files of each variant, with the name, the file that it points to, the size, and the SHA-256 digest that the
.modulefile declares. - The dependencies and dependency constraints of each variant, including what each one requires, prefers, or strictly requires, the versions that it rejects, and the reason if one was given.
- The capabilities that each variant provides.
- For a variant that is available from another component, the coordinates of that component.
Use this information to understand Gradle variant selection. Gradle matches the consumer's requested attributes against the attributes of each variant, which explains why Gradle selected one JAR file over another.
Artifex serves the .module file exactly as it was deployed, so a build resolves what the publication declared. A .module file that isn't valid Gradle Module Metadata is still stored and served, but Artifex doesn't show its contents as variants.
Fetch variant files eagerly
A .module file lists every variant file. Fetch Gradle variant files eagerly on an upstream makes Artifex fetch those files as soon as a .module file arrives from that upstream, before a build requests them. The setting is on by default.
To turn it off, follow these steps:
- Open the repository and go to Upstreams.
- In the upstream's row, click Edit.
- Expand Advanced, and turn off Fetch Gradle variant files eagerly.
- Click Save upstream.
This setting trades storage for latency. Artifex fetches every file of every variant, including sources and Javadoc files that your builds might never request. If the upstream doesn't have a listed file, Artifex skips it without failing the request that fetched the .module file.
The option applies to remote upstreams. Files deployed to the repository are already stored there, and files from an Artifex upstream are proxied, not stored.