Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
        • Setting up Maven
      • Deleting an artifact from a registry
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  1. Step-by-step guides
  2. Managing artifacts
  3. Java artifact
  4. Setting up Maven

Setting up Maven

Written by
Yandex Cloud
Updated at November 17, 2026
View in Markdown
  1. Create the following environment variables depending on the authentication method:

    IAM token
    API key
    1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

    2. Create the REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables:

      export REGISTRY_USERNAME="iam"
      export REGISTRY_PASSWORD="<IAM_token>"
      

      Where:

      • REGISTRY_USERNAME: Authentication method.
      • REGISTRY_PASSWORD: Body of the previously obtained IAM token.

    Note

    The IAM token's lifetime is limited to 12 hours.

    1. Create an API key for the service account you are going to use for authentication.

      When creating a key, specify its scope:

      • yc.cloud-registry.artifacts.pull: To pull artifacts from the registry.
      • yc.cloud-registry.artifacts.push: To push artifacts to the registry.
    2. Create the REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables:

      export REGISTRY_USERNAME="api_key"
      export REGISTRY_PASSWORD="<API_key>"
      

      Where:

      • REGISTRY_USERNAME: Authentication method.
      • REGISTRY_PASSWORD: Body of the previously created API key.

    Note

    The API key maximum lifetime is set manually when you create the key.

  2. Open the file with the global Maven settings.

    By default, the configuration file is located in the current user's .m2 directory (~/.m2/settings.xml for Unix-like OSes and %USERPROFILE%\.m2\settings.xml for Windows). Learn more about the configuration file structure in this Maven guide.

  3. Add a new repository to the repositories section of the Maven settings file:

    <repository>
        <id>local</id>
        <url>registry.yandexcloud.net/maven/<registry_ID></url>
    </repository>
    
  4. Add a new server to the servers section of the Maven settings file:

    <server>
        <id>local</id>
        <username>${env.REGISTRY_USERNAME}</username>
        <password>${env.REGISTRY_PASSWORD}</password>
    </server>
    

Scope is an API key parameter that restricts the key's use to specific operations in addition to the service account's access permissions. For details, see API keys with scope and validity limits.

Was the article helpful?

Previous
Deleting a Helm chart from a registry
Next
Setting up npm
© 2026 Direct Cursus Technology L.L.C.