Configure the Dart CLI to connect to your Artifactory repositories.
Prerequisite: Before connecting the Dart CLI to Artifactory, you must have an existing pub repository in Artifactory. For more information, see Create a pub Repository.
Logged in vs. Anonymous User: You can work with pub and Artifactory as a logged-in user or anonymously. To work with Artifactory using Anonymous Access, configure that access under Administration > Security > General. For details, see Allow Anonymous Access.
To connect the Dart CLI to Artifactory:
Run this command to add the Artifactory repository to your pub client:
dart pub token add "https://[JFrogPlatformURL]/artifactory/api/pub/<REPO_NAME>"Where:
[JFrogPlatformURL]: The URL of your JPD<REPO_NAME>: The name of the target repository in Artifactory
For example:
dart pub token add "https://company.jfrog.io/artifactory/api/pub/pub-local"When prompted, enter your Artifactory identity token.
Set the environment variable:
export PUB_HOSTED_URL="https://[JFrogPlatformURL]/artifactory/api/pub/<REPO_NAME>"Where:
[JFrogPlatformURL]: The base URL of your JPD<REPO_NAME>: The name of the target repository in Artifactory
For example:
export PUB_HOSTED_URL="https://company.jfrog.io/artifactory/api/pub/pub-local"
Note
You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.
Next steps: