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
- You have installed the Conan client.
- You have created a Conan repository.
- You have the Download/View permission on the current repository. For details about how to obtain this permission, see Configuring Repository Permissions.
Procedure
- Access self-hosted repos using your Huawei Cloud account.
- Select the target Conan repository on the self-hosted repo page.
- Click Tutorial in the upper right corner of the repository page.
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
- Go to the Tutorial page of Conan repository.
- In the displayed dialog box, select Download the provided configuration file.

- 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.
- 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
|
| 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 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
- Complete related configurations by referring to Tutorial.
- 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
- Complete related configurations by referring to Tutorial.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot



