Use CLI with Bower Version 1.5 and above

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

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

  1. bower-art-resolver - A custom, pluggable Bower resolver which is dedicated to integrate with Artifactory.

  2. bower - Bower version 1.5.0 and above.

Once Bower is installed, add the Artifactory Bower resolver by editing your ~/.bowerrc configuration file

Adding a Pluggable Resolver

{
  "resolvers": [
    "bower-art-resolver"
  ]
}

Bower Documentation

For more information, please refer to the Bower documentation on Pluggable Resolvers.

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 ):

Replacing the default registry

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

Using the Bower Shorthand Resolver

If you want to configure the Bower Shorthand Resolver to work with Artifactory, please refer to Bower Shorthand Resolver below.

.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 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