# `maven_artifact`

A selected Maven archive fetched as one checksum-pinned graph action.

Usually emitted by [`gradle_dependencies`](/reference/prelude/gradle_dependencies). Locked imports name artifacts by a digest of the full `group:name:version` coordinate. Selection names include native variant and file identity; repository-acquired artifacts are scoped to their configuration so independently acquired definitions cannot collide.

For a JAR, the target provides `java_library` with `compile_jar` and `runtime_jar`. A native metadata-only module explicitly selected through its owner's `artifacts` map provides no JAR and declares no download.

Selected AARs use a checksum-pinned ZIP extraction producer and a deferred contents continuation. `classes.jar` is optional. Supported archives expose classes followed by sorted embedded `libs/*.jar`, asset roots/files and ABI-tagged native libraries through transitive providers. An archive containing only assets or native libraries has an empty Java classpath. No Android SDK is required for this subset.

Resource entries or symbols, manifest declarations needing merging, consumer rules and unknown contents fail before a consumer runs. AARs with those contents still require native Gradle. Direct AAR declarations must go through `gradle_dependencies` so contents are discovered before publication.

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `group` | string | yes | Maven group |
| `module` | string | yes | Maven artifact name |
| `version` | string | yes | Locked version |
| `file` | string | no | Selected JAR or AAR filename, or empty for an explicitly selected metadata-only module |
| `integrity` | map&lt;string,string&gt; | for an archive | Single checksum requirement keyed by algorithm |
| `urls` | list&lt;string&gt; | for an archive | Ordered mirrors |
| `_affected_srcs` | list&lt;string&gt; | no | Resolver-owned provenance paths for affected-test selection, not download action inputs |
| `_aar_archive` | bool | no | Resolver-owned AAR extraction producer marker |
| `_aar_contents` | map&lt;string,any&gt; | no | Resolver-owned validated extraction root and sorted archive entries |

The `build` capability exposes `default` and `jar` output groups. Downloads use the configured action cache and CAS, with integrity and relative output location in their identity, not mirror URLs. Native lockfiles remain unchanged.
