In order to use Bower with Artifactory you need 2 components (npm packages):
bower-art-resolver - A custom, pluggable Bower resolver which is dedicated to integrate with Artifactory.
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