Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Registry
  • Getting started
    • All guides
    • Creating a registry
        • Setting up Maven
  • Access management
  • Pricing policy
  • CLI reference
  • 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 January 22, 2025
  1. 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). You can learn more about the configuration file structure in the Maven documentation.

  2. Add a new repository to the configuration file's repositories section:

    <repository>
        <id>local</id>
        <url>registry.yandexcloud.net/maven/<registry_ID></url>
    </repository>
    
  3. Depending on the authentication method:

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

    2. Add a new server to the servers section of the Maven settings:

      <server>
          <id>local</id>
          <username>${env.REGISTRY_USERNAME}</username>
          <password>${env.REGISTRY_PASSWORD}</password>
      </server>
      
    3. Create environment variables named REGISTRY_USERNAME and REGISTRY_PASSWORD containing data for IAM token authentication:

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

      Where <IAM_token> is the IAM token you got earlier.

    1. Get an OAuth token for the Yandex account you are going to use for authentication.

    2. Add a new server to the servers section of the Maven settings:

      <server>
          <id>local</id>
          <username>${env.REGISTRY_USERNAME}</username>
          <password>${env.REGISTRY_PASSWORD}</password>
      </server>
      
    3. Create environment variables named REGISTRY_USERNAME and REGISTRY_PASSWORD containing data for OAuth token authentication:

      export REGISTRY_USERNAME="oauth"
      export REGISTRY_PASSWORD="<OAuth_token>"
      

      Where <OAuth_token> is the OAuth token you got earlier.

Was the article helpful?

Previous
Deleting a Helm chart from a registry
Next
Setting up npm
Yandex project
© 2025 Yandex.Cloud LLC