Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Download package version assets

Focus mode
Download package version assets - CodeArtifact

An asset is an individual file (for example, an npm .tgz file or Maven POM or JAR file) stored in CodeArtifact that is associated with a package version. You can download package assets using the get-package-version-assets command. This allows you to retrieve assets without using a package manager client such as npm or pip. To download an asset you must provide the asset's name which can be obtained using the list-package-version-assets command, for more information see List package version assets. The asset will be downloaded to local storage with a file name that you specify.

The following example downloads the guava-27.1-jre.jar asset from the Maven package com.google.guava:guava with version 27.1-jre.

aws codeartifact get-package-version-asset --domain my_domain --domain-owner 111122223333 --repository my_repo \ --format maven --namespace com.google.guava --package guava --package-version 27.1-jre \ --asset guava-27.1-jre.jar \ guava-27.1-jre.jar

In this example, the file name was specified as guava-27.1-jre.jar by the last argument in the preceding command, so the downloaded asset will be named guava-27.1-jre.jar.

The output of the command will be:

{ "assetName": "guava-27.1-jre.jar", "packageVersion": "27.1-jre", "packageVersionRevision": "YGp9ck2tmy03PGSxioclfYzQ0BfTLR9zzhQJtERv62I=" }
Note

To download assets from a scoped npm package, include the scope in the --namespace option. The @ symbol must be omitted when using --namespace. For example, if the scope is @types, use --namespace types.

Downloading assets using get-package-version-asset requires codeartifact:GetPackageVersionAsset permission on the package resource. For more information about resource-based permission policies, see Resource-based policies in the AWS Identity and Access Management User Guide.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.