Help Center/ CodeArts Artifact/ Best Practices/ Migrating Local Repository Data to CodeArts Artifact/ Migrating Local Maven Repository Data to CodeArts Artifact
Updated on 2026-03-13 GMT+08:00

Migrating Local Maven Repository Data to CodeArts Artifact

A local repository is a copy of software packages or dependencies stored on your computer. When you use Maven to manage dependencies, the tools download dependencies from remote repositories to your local repository. However, CodeArts Artifact enforces strict permissions for storing, pushing, and pulling dependencies and final products generated during development to support effective team collaboration. Therefore, after migrating Maven repository data from your local disk to CodeArts Artifact, you can manage operations and maintenance more efficiently in one place. To meet this need, CodeArts Artifact provides a tool to help you quickly migrate Maven repository data in batches to the Maven repository in self-hosted repos.

Constraints

Only local Maven and npm repository data can be migrated to self-hosted repos in CodeArts Artifact. This section describes how to migrate local Maven repository data to self-hosted repos in CodeArts Artifact.

Prerequisites

Step 1: Obtain Target Maven Repository Information from CodeArts Artifact

  1. Use your Huawei Cloud account to access self-hosted repos.
  2. In the left pane, click the target Maven repository name to go to its details page, and view the Repo URL.
  3. Click next to the repository URL to copy it.
  4. Click Tutorial in the upper-right corner of the page. In the displayed dialog box, click Download Configuration File to download the settings.xml file to the localhost.

    Open the file on the localhost and find the username and password.

Step 2: Configure Migration Tool

  1. Use your Huawei Cloud account to access self-hosted repos.
  2. In the left pane, select the target Maven repository.
  3. Click the repository name. In the upper-right corner of the page, click and select Download Migration Tool to download the MigrateTool.zip package to the localhost. Then decompress it to obtain uploadArtifact.py (migration tool) and artifact.conf (configuration file).
  4. Configure the  artifact.conf  file using the example below. Only the required parameters are listed. Other parameters can be deleted.

    [artifact]

    packageType = Component type. Set it to Maven.

    userInfo = username:password (username and password obtained in 4 of Step 1: Obtain Target Maven Repository Information from CodeArts Artifact)

    repoRelease = Repository URL (repository URL obtained in 3 of Step 1: Obtain Target Maven Repository Information from CodeArts Artifact)

    repoSnapshot = Repository URL (repository URL obtained in 3 of Step 1: Obtain Target Maven Repository Information from CodeArts Artifact). This parameter is involved when the Maven artifact type is Snapshot.

    srcDir = Directory path of the local Maven repository to be migrated. The value is user-defined, for example, C:\Users\xxxxxx\repository.

Step 3: Migrate Data

Run the migration tool obtained in 3 by executing this command:

python uploadArtifact.py

Step 4: Verify Migration Results

Go to the target Maven repository in self-hosted repos and verify whether the local Maven repository data was uploaded successfully.

If the migration fails, try again or contact customer service.