# jf conan Run native Conan commands with Artifactory integration and optional build-info collection. ## When to Use Use `jf conan` to run Conan C/C++ package manager commands with Artifactory integration. This enables: * Resolving Conan packages from Artifactory's Conan repository * Publishing packages to Artifactory * Collecting build-info for C/C++ builds ## Prerequisites * Conan must be installed and configured with `conan remote add` to point to your Artifactory Conan repository. * Configure a server with `jf config add` or `jf c add`. * Authentication to Artifactory is required. *** ## Build: `jf conan` Run native Conan commands with Artifactory integration and optional build-info collection. **To run Conan with Artifactory integration:** ### Synopsis ``` jf conan [options] ``` **Aliases:** none ### Arguments | Argument | Required | Description | | ------------------- | -------- | ------------------------------------------------------------------------------ | | `` | Yes | Arguments and options for the Conan command (for example, `install`, `create`) | ### Build Options | Flag | Default | Description | | ---------------- | ------- | ---------------------------------------------------------------------------------- | | `--build-name` | — | Build name for build-info. Requires `--build-number`. | | `--build-number` | — | Build number for build-info. Requires `--build-name`. | | `--module` | — | Optional module name for build-info. Requires `--build-name` and `--build-number`. | | `--project` | — | JFrog Artifactory project key | ### Build Examples #### View Help ```bash jf conan --help ``` #### Install Dependencies with Build-Info ```bash jf conan install . --build=missing --build-name= --build-number= ``` Where: * `--build=missing` builds packages from source if pre-built binaries are not available * `` is a name for the build (e.g., `my-cpp-app`) * `` is a number or identifier for the build run (e.g., `1`) For example: ```bash jf conan install . --build=missing --build-name=my-cpp-app --build-number=1 ``` #### Create a Package ```bash jf conan create . --name=hello --version=1.0 --build-name= --build-number= ``` For example: ```bash jf conan create . --name=hello --version=1.0 --build-name=my-cpp-app --build-number=1 ``` *** ## Important Notes * **No separate config command**: Unlike other build tools, Conan does not have a `jf conan-config` command. Configure Conan remotes to point to Artifactory using standard `conan remote add`. * **Conan 2.x compatibility**: Ensure your Conan version is compatible with the CLI version. Check `conan --version` and `jf --version`. * **Build-info**: Use `--build-name` and `--build-number` to track dependencies and artifacts. ## CI/CD Example (GitHub Actions) ```yaml # .github/workflows/build.yml steps: - uses: actions/checkout@v4 - name: Setup JFrog CLI uses: jfrog/setup-jfrog-cli@v4 env: JF_URL: ${{ vars.JF_URL }} JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} - name: Setup Conan run: | pip install conan conan remote add artifactory https://acme.jfrog.io/artifactory/api/conan/conan-local - name: Install dependencies run: jf conan install . --build=missing --build-name=my-cpp-app --build-number=${{ github.run_number }} - name: Upload packages run: jf conan upload "*" --all -r artifactory --build-name=my-cpp-app --build-number=${{ github.run_number }} - name: Publish build info run: jf rt build-publish my-cpp-app ${{ github.run_number }} ``` ## Troubleshooting | Symptom | Cause | Fix | | ------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------ | | Conan cannot resolve from Artifactory | Conan remote not configured | Run `conan remote add artifactory ` | | 401 / 403 on upload | Invalid credentials or insufficient permissions | Re-run `jf config add`; verify `conan remote` credentials | | Conan 2.x compatibility issues | CLI version and Conan version mismatch | Check `conan --version` and `jf --version` for compatibility | | Build-info not collected | `--build-name` and `--build-number` not passed | Add both flags to the Conan command | **Enable debug logging:** `export JFROG_CLI_LOG_LEVEL=DEBUG`
## Related Topics * [Build Tools Overview](/artifactory/docs/build-tool-commands) — Capabilities matrix and tool reference * [Native Mode](/artifactory/docs/native-mode) — Supported packages with Native Mode