Pub

Artifactory natively supports Pub repositories for the Dart, Flutter, and Angular Dart projects, giving you full control of your deployment and the dependency resolution process of PubRead More >

packages through the Pub package manager. Dart is a programming language designed for client development, such as for the web and mobile apps.Read Less >

Blog

How to Use Pub Repositories in Artifactory

Documentation

Documentation - Pub Repositories in Artifactory

What is Pub, and how does it integrate with JFrog Artifactory?

Pub is the package manager for Dart, commonly used in Dart and Flutter projects to manage libraries and dependencies. JFrog Artifactory can serve as a Pub repository, enabling organizations to store, manage, and distribute Dart packages. By integrating Pub with JFrog Artifactory, teams can centralize package management, control access to internal packages, and manage package versions in a secure environment.

How do I configure Pub to use JFrog Artifactory as a package repository?

To configure Pub to use JFrog Artifactory:

Add a custom package source in the pubspec.yaml file for your Dart or Flutter project, pointing to your Artifactory repository URL:

dependencies:
your_package:
hosted:
name: your_package_name
url:
version: ^1.0.0

Replace with the URL of your Artifactory repository and your_package_name with the name of the package.

After updating the configuration, run dart pub get (or flutter pub get for Flutter) to install packages from Artifactory.

How do I upload Dart packages to JFrog Artifactory’s Pub repository?

To upload Dart packages to JFrog Artifactory:

Ensure your Dart package is correctly structured, including a pubspec.yaml file and any necessary files for the package.
Use the dart pub publish command and specify the Artifactory repository URL, if necessary, to direct the upload:

dart pub publish --server=

You may need to set up authentication with Artifactory if required by the repository.

What are the benefits of using JFrog Artifactory with Pub?

Centralized Management of Dart Packages: Store both public and private Dart packages in a single, secure location.

Version Control and Dependency Management: Artifactory provides version control and dependency resolution to ensure builds are consistent across environments.

Access Control and Security: Artifactory’s role-based access controls let you securely manage who can access, upload, or download Dart packages.

Remote Caching for Faster Builds: Artifactory can cache remote Pub packages, reducing dependency on external sources and improving build speed.

What should I do if I encounter issues using Pub with JFrog Artifactory?

Check the repository URL and authentication setup in the pubspec.yaml file to make sure they’re correctly configured.

Verify network connectivity and ensure that permissions are correctly set in Artifactory to allow access.

Run dart pub get (or flutter pub get) and check for error messages that may indicate issues with the repository configuration or permissions.

Ensure the package structure is valid and that the pubspec.yaml file includes the correct metadata for publishing.

Trusted Releases Built For Speed

About Pub

The official public package repository for Dart and Flutter - developed and maintained by Google's Flutter team.
Learn More! Book a session with our technical team