Configure the Pub Client to Work With Artifactory

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

To use Artifactory with your Pub client, you will first need to set Artifactory as a Pub repository, and then to resolve and deploy the relevant Dart/ Flutter package.

Prerequisite

You will need to generate an authentication token. For more information, see Access Token Authorization Headers.Access Tokens

Step 1: Add Artifactory to your / etc/pub/repositories File

  1. Navigate to Application Module | Artifactory | Artifacts.

  2. Select the desired repository.

  3. Select Set Me Up.

  4. In the Configure tab, add the repository to your client using the following command and run it.

    HTTPS-Mode Only

    Pub authentication to Artifactory is supported only through HTTPS-Only mode.

    setmeup_pub_configure.png

Step 2: Deploy Dart/ Flutter Packages

To deploy a Dart/ Flutter package into an Artifactory repository, use the following cURL with the relevant path parameters:

cURL

curl -u<USERNAME>:<PASSWORD> -T <file>.tar.gz  " https://localhost:8080/artifactory/dart-pub-local/<>/<PACKAGE_NAME>/<FILE>/<VERSION>.tar.gz"

Deploying a Package Using the UI

Indexing Dart/Flutter Packages

For your files to be indexed properly, it is very important to ensure that all deployment of Dart/ Flutter packages into Artifactory occurs under the <REPOSITORY>/<PACKAGE_NAME/ <FILE> <VERSION> structure. Packages deployed anywhere else will not be indexed.

To deploy a Dart/ Flutter package to Artifactory, do the following:

  1. Navigate to Artifactory | Artifacts | Deploy.

  2. Select your Pub repository as the Target Repository.

  3. In the Target Path, specify the relative path in the target repository.

    pub_deploy_setmeup.png

Step 3: Resolve and Deploy Dart/ Flutter Packages

To resolve Dart packages:

  1. In the Application module, navigate to Artifactory | Artifacts.

  2. In the Artifact Tree Browser, select a Pub repository and click Set Me Up.

    setmeup_pub_resolve.png