Skip to end of metadata
Go to start of metadata

Overview

Artifactory introduces advanced artifact management to the world of C/C++ through support for local repositories that work directly with the Conan client to manage Conan packages and dependencies. As a repository to which builds can be uploaded, and from which dependencies can be downloaded, Artifactory offers many benefits to C/C++ developers using Conan:

  1. Secure, private repositories for C/C++ packages with fine-grained access control according to projects or development teams
  2. Automatic layout and storage of C/C++ packages for all platforms configured in the Conan client
  3. The ability to provision C/C++ dependencies from Artifactory to the Conan command line tool from local repositories.
  4. Enterprise features such as high availability, repository replication for multi-site development, different options for massively scalable storage

...and much more.

For more details on building Conan packages and working with the Conan client, please refer to the Conan documentation.

Artifactory Community Edition for C/C++

Conan repositories are available in Artifactory CE.

> Learn more

Configuration

Local Repositories

To enable calculation of C/C++ package metadata, set Conan to be the Package Type when you create your local repository.

Conan local repository

Make sure to also select conan-default as the repository layout.

Page Contents





Using Conan with Artifactory

Once the Conan client is installed, you can access Conan repositories in Artifactory through its command line interface. You can only install packages from or export packages to your Artifactory local Conan repository using the Conan client. 

Local vs. Remote

Don't let Conan terminology confuse you. For the purposes of this integration, the Conan "Remote" is actually the Artifactory local repository you have created for Conan packages.

Once you have created your Conan repository, select it in the Tree Browser and click Set Me Up,  to see the code snippets you will need in order to use your repository as a source to install packages and as a target for export.

Conan Set Me Up


In the sections below, <REMOTE> is used to denote the logical name you set with which the Conan client can identify the Conan local repository in Artifactory.

Adding Your Repository

To use your local repository with Conan, you first need to add it as a Conan "Remote" to the client as follows:

conan remote add <REMOTE> http://<ARTIFACTORY_URL>/api/conan/<REPO_KEY>

Where:

<REPO_KEY> is the repository key

Conan repositories must be prefixed with api/conan in the path

When accessing a Conan repository through Artifactory, the repository URL must be prefixed with api/conan in the path. This applies to all Conan commands including conan install.

For example, if you are using Artifactory standalone or as a local service, you would access your Conan repositories using the following URL:

http://localhost:8081/artifactory/api/conan/<repository key>

Or, if you are using Artifactory SaaS, the URL would be:

https://<server name>.jfrog.io/<server name>/api/conan/<repository key>

Authenticating the Conan Client

To authenticate the Conan client to Artifactory you need to log in using:

conan user -p <PASSWORD> -r <REMOTE> <USERNAME>

Accessing Artifactory anonymously

If Artifactory is configured for anonymous access, you may skip authenticating the Conan client. 

Installing Dependencies

To install dependencies from Artifactory as defined in your conanfile.txt file use:

conan install . -r <REMOTE>

Uploading Packages

To upload packages to your Artifactory local Conan repository use:

 conan upload <RECIPE> -r <REMOTE> --all

Where <RECIPE> specifies your Conan recipe reference formatted <NAME>/<VERSION>@<USER>/<CHANNEL>


Viewing Individual Conan Package Information

Artifactory lets you view selected metadata of a Conan package directly from the UI.
In the Artifacts tab, select Tree Browser and drill down to select the package file you want to inspect. The metadata is displayed in the Conan Info tab. The specific information displayed depends on the tree item you have selected. Selecting the root item of a package displays details of the Conan recipe used to upload the package.

Conan recipe information

If you select one of the packages, you get detailed Conan Package info including Settings, Options and dependencies ("Requires")

Conan package information

Conan Package Requires info



Conan V2 Package Support

Conan server API v2 is supported and introduces an extension of the binary layout to support Conan Package revisionsRevisions allow you to change your artifacts while keeping the same Conan reference and is intended to achieve package immutability, by preventing data from being overwritten on the server.
This example shows the layout with "9999" as the <packageId>, "1" is the Recipe Revision, and "4" is the Package Revision.

user/lib/1.0/channel/1/package/9999/4/*

Revisions Support By Conan Client

When the Revision features is enabled, the Conan client searches for the latest revision in Artifactory per reference, unless specified otherwise by the user. It is not mandatory to upgrade your conan client version to use Artifactory 6.9 however if you want to work with revisions you need to download use Conan client 1.13 with the revision mode enabled.

The Conan client, by default, searches for the latest revision in Artifactory per reference, unless specified otherwise by the user.

Conan Package V1 Backward Compatibility

Artifactory 6.9.0 provides backward compatibility for packages created with Conan server API v1 by automatically migrating the Conan server API v1 binary layout to the new format. 
Migration to Conan server API V2 starts after the upgrade process is complete (in all nodes in case of High Availability) and all Conan API endpoints are blocked and cannot be accessed.
After migration, the default revision for all Conan server API v1 packages is set to "0" for both Recipe revision and Package revision, and endpoints will be accessible again.

By default, two threads are dedicated for the migration job. Before upgrading Artifactory to 6.9, you can modify this setting in the $ARTIFACTORY_HOME/etc/artifactory.system.properties file.
Note that you can allocate more threads during the migration process but need to restart Artifactory.

artifactory.conan.v2.migration.job.queue.workers = 2 (default)

System Requirements

  • Artifactory version 6.9.0 and above.
  • Artifactory Pro license and above or Artifactory CE for C/C++.
  • Conan Client version 1.13.0 and above with the Revisions mode enabled. To enable the Revision mode on the Conan Client, see Conan Client

Revision Indexing

Use the Conan client to deploy your packages. The Conan client will by default request the latest revision of a Conan reference requested.
Upon deployment using the Conan client, a .timestamp file is created under each revision root for each Recipe and Package revision root.
This file contains the epoch time of deployment (in milliseconds, for example, 1547984992855) and is created only when using the Conan client

Only Use the Conan Client to deploy Conan Packages

Do not deploy the Conan packages in the UI or via REST API deployment to prevent index consistency and failed resolutions.


Viewing Individual Conan V2 Package Information

Artifactory lets you view selected metadata of a Conan package directly from the UI. In the Artifacts tab, select Tree Browser and drill down to select the package file you want to inspect. The metadata is displayed in the Conan Info tab. The specific information displayed depends on the tree item you have selected. Selecting the root item of a package displays details of the Conan recipe used to upload the package.

Viewing Conan Package Revisions 

From Artifactory 6.9.0, Conan v2 is supported and introduces a new Conan format layout to support the Revisions attribute.

The following example shows a package with the default revision "0 "for both Recipe and Package.




  • No labels