You need to enable JavaScript to run this app.
Container Registry

Container Registry

Copy page
Download PDF
Getting started
Upload and download Maven-format packages
Copy page
Download PDF
Upload and download Maven-format packages
The artifact repository supports hosting artifacts, allowing users to create artifact repositories and upload and download artifacts. This article introduces how to quickly use the artifact repository to upload and download Maven artifacts.​
Prerequisites​
  • To enable IAM users to operate the artifact repository, ensure that the relevant policy and role authorization for the artifact repository have been completed. For detailed operating instructions, refer to Permissions Management.​
  • Maven has been installed in the local environment.​
Procedure​
Step 1: Create an instance​
  1. Log in to the Artifact repository console.​
  1. In the left navigation bar, click Instances. Then, in the Instances area on the right page, click Create a Basic Edition Instance.​
  1. Configure the instance parameters.​
  • ​
    Parameter​
    Description​
    Instance Name​
    The name of the instance, which cannot be modified.​
    Repository Domain Name​
    The domain name for accessing the repository, which is automatically generated by the system and cannot be modified.​
    Billing method​
    The billing method of the instance. Currently, only Pay-as-you-go is supported and cannot be modified.​
    ​
  1. Click Confirm to navigate to the Confirm Order interface.​
  1. After confirming the configuration details, billing type, purchase quantity, and price in the order, if there are no issues, check the box for I have read and agreed to the "Service Terms for the Basic Edition of Artifact Repository".​
  1. Click confirm and wait for the system to complete instance creation.​
Step 2: Create a repository​
  1. In the left navigation bar, select Instances. In the Instances area on the right page, click to enter the artifact repository instance.​
  1. At the top of the left navigation bar, select the Maven package format, and then in the menu bar, choose Repository Management and click on New Repository to enter the repository configuration page.​
  1. Configure the parameters of the artifact repository.​
  1. Click Confirm.​
Step 3: Configure repository credentials​
  1. In the dropdown menu at the top of the left navigation bar, select the Maven package format, and in the menu bar, select registry management.​
  1. In the repository management list, click Set permanent credential. Credentials for the artifact repository can now be configured.​
  1. Please copy the access credentials and add them to the local settings.xml file. <username> and <password> are the username and password for your artifact repository.​
tip​
In most cases, you can find the settings.xml file in the ~/.m2 directory.​
​
<settings>​
<servers>​
<server>​
<id>[REPOSITORY ID]</id>​
<username>[********] </username>​
<password>[********]</password>​
</server>​
</servers>​
</settings>​
​
Step 4: Upload package​
Run the following command to upload the package. For more configuration details, refer to Upload package (command line).​
mvn deploy:deploy-file -Dfile=<path-to-jar-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=jar -DrepositoryId=<repository-id> -Durl=<repository-url>​
Step 5: Download packages​
  1. Copy and add the following configuration to the settings.xml file.​
​
<settings>​
<profiles>​
<profile>​
<id>[REPOSITORY_ID]</id>​
<activation>​
<activeByDefault>true</activeByDefault>​
</activation>​
<repositories>​
<repository>​
<id>[REPOSITORY_ID]</id>​
<name>[ARTIFACT_ID]</name>​
<url>[REPOSITORY_URL]/</url>​
<releases>​
<enabled>true</enabled>​
</releases>​
<snapshots>​
<enabled>true</enabled>​
</snapshots>​
</repository>​
</repositories>​
</profile>​
</profiles>​
</settings>​
​
  1. Copy and add the following configuration to the pom.xml file.​
​
<project>​
<dependencies>​
<dependency>​
<groupId>[GROUP_ID]</groupId>​
<artifactId>[ARTIFACT_ID]</artifactId>​
<version>[VERSION]</version>​
</dependency>​
</dependencies>​
</project>​
​
  1. Execute the following command to package and download packages.​
​
mvn package​
​
View results​
  1. After executing the packaging command, the system automatically packages and downloads. When 'BUILD SUCCESS' is displayed in the command line, it indicates that the package has been downloaded successfully.​
  • ​​​
  1. Simply enter the Target folder to view the downloaded package.​
  • ​​​
​
Last updated: 2025.10.24 11:20:36