Updated on 2026-08-10 GMT+08:00

Uploading and Downloading a Conan Package on the Client

CodeArts Artifact can connect to local Conan clients. You may upload your private packages from your local Conan client to self-hosted repos and share them with others, who can download these Conan packages through their clients.

Conan Package

Conan is a package manager for C and C++ developers. It allows you to manage project dependencies, compile and build processes, and distribute compiled binaries.

Constraints

The repository password for a self-hosted repo is account-specific. If you are prompted for a password while using a different account, download the configuration file from the repository's Tutorial tab to obtain it.

Prerequisites

Procedure

  1. Access self-hosted repos using your Huawei Cloud account.
  2. Select the target Conan repository on the self-hosted repo page.
  3. Click Tutorial in the upper right corner of the repository page.

Tutorial

Adding a Conan repository by downloading provided configuration file

Edit the remotes.json configuration file for the Conan repository source. By default, the file is stored in the current user directory.

  • Path for Conan V1 version: {{User}}/.conan/remotes.json
  • Path for Conan V2 version: {{User}}/.conan2/remotes.json
  1. Go to the Tutorial page of Conan repository.
  2. In the displayed dialog box, select Download the provided configuration file.

  3. Add {"name":"{{xxx}}","url":"https://{{xxx}}/artgalaxy/api/conan/{{xxx}}/","verify_ssl":false} from the downloaded file to the configuration file. Note that setting verify_ssl to false means the HTTPS certificate is ignored.

    The following is an example of the remotes.json file after modification:

    • For the Conan V1 client, run the conan user command to configure your account and password.
    • For the Conan V2 client, run the conan remote login command to configure your account and password.

  4. After the configuration is successful, run the conan remote list command to verify that the repository appears in the list.

Adding a Conan repository by following command-line configuration

Dependency Manager

Description

conanV1

Set Select dependency manager to conanV1 and copy the command line to your local PC for execution. (The password is hidden by default; hover over the command area and click to automatically include the password in the command line.)

conanV2

Set Select dependency manager to conanV2 and copy the command line to your local PC for execution. (The password is hidden by default; hover over the command area and click to automatically include the password in the command line.)

NOTE:

When configuring the Conan repository on your local PC, ensure that the repository address starts with api/conan. Example: https://{{ Domain name}}/artgalaxy/api/conan/{{ Repository name}}.

Publishing a Conan Package Using the Client

  1. Complete related configurations by referring to Tutorial.
  2. Upload the local Conan package to self-hosted repos.

     conan upload <PATTERN> -r <REMOTE>
    • Replace <REMOTE> with the repository alias you defined when adding the Conan repository by referring to "Adding a Conan repository by following command-line configuration" in Tutorial. For example, my-conan-test.
    • Replace <PATTERN> with the package or recipe that you want to upload. The recipe format is <NAME>/<VERSION>@<USER>/<CHANNEL>.

      Example: conan upload "*" -r my-conan-test

Downloading a Conan Package to the Client

  1. Complete related configurations by referring to Tutorial.
  2. Download the dependencies declared in the conanfile.txt file.

    conan install . -r <REMOTE>

    Replace <REMOTE> with the repository alias you defined when adding the Conan repository by referring to "Adding a Conan repository by following command-line configuration" in Tutorial. For example, if the repository alias is my-conan-test, the command is conan install . -r my-conan-test.