Use CLI with Bower Below Version 1.5

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

Version support

Older versions of Bower are only supported by Artifactory up to version 4.2.0.

In order to use Bower below version 1.5 with Artifactory you need 2 components (npm packages):

  1. bower-art-resolver - A custom Bower resolver dedicated to integrate with Artifactory.

  2. bower-art - A temporary custom Bower CLI with the pluggable resolvers mechanism currently in pending pull request.

The bower-art package is a peer dependency of bower-art-resolver. Therefore, both can be easily installed with:

npm install -g bower-art-resolver

Use bower-art instead of bower

While Artifactory support for Bower is in Beta, after installing the required components, you need to execute bower-art instead of each bower command.

For example, use bower-art install <pkg> instead of bower install <pkg>

Updating Resolver

In order to update Artifactory resolver, please uninstall the "bower-art" npm package first, and then install the resolver. This step is necessary because npm doesn`t update peer dependencies.

Once bower-art is installed, replace the default registry with a URL pointing to a Bower repository in Artifactory by editing your ~/.bowerrc configuration file (the example below uses a repository with the key bower-repo ):

{
  "registry": "http://localhost:8081/artifactory/api/bower/bower-repo"
}

.bowerrc file location

Windows: %userprofile%\.bowerrc

Linux: ~/.bowerrc

Tip

We recommend referencing a Virtual Repositories URL as a registry. This gives you the flexibility to reconfigure and aggregate other external sources and local repositories of Bower packages you deployed.

Once the Bower command line tool is configured, every bower-art install command will fetch packages from the bower repository specified above. For example:

$ bower install bootstrap
bower bootstrap#*           not-cached art://twbs/bootstrap#*
bower bootstrap#*           resolve art://twbs/bootstrap#*
bower bootstrap#*           extract archive.tar.gz
bower bootstrap#*           resolved art://twbs/bootstrap#e-tag:0b9cb774e1