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.
Step 1: Add Artifactory to your / etc/pub/repositories File
Navigate to Application Module | Artifactory | Artifacts.
Select the desired repository.
Select Set Me Up.
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.
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:
Navigate to Artifactory | Artifacts | Deploy.
Select your Pub repository as the Target Repository.
In the Target Path, specify the relative path in the target repository.
Step 3: Resolve and Deploy Dart/ Flutter Packages
To resolve Dart packages:
In the Application module, navigate to Artifactory | Artifacts.
In the Artifact Tree Browser, select a Pub repository and click Set Me Up.