Makes WebJars super-easy to find and install from the command line.
Requires Java 5 and Maven 3.0.4.
Download the latest release. Unpack it somewhere and add the bin folder to your path. You can now run webjars list jquery
.
To invoke the plugin with the mvn webjars:<goal>
shortcut, you must either add the plugin to Maven's settings.xml or to your project's pom.xml. If you do neither, you must use mvn org.webjars:webjars-maven-plugin:<goal>
.
In settings.xml (in $USER_HOME/.m2 by default), add the following line to the pluginGroups
element (more info):
<pluginGroup>org.webjars</pluginGroup>
The shortcut is now available globally.
In your project's POM, add the plugin to the plugins
element:
<plugin>
<groupId>org.webjars</groupId>
<artifactId>webjars-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
</plugin>
The shortcut is now available in the project's directory
Lists all available WebJars. Can be used from any directory.
The optional webjar
parameter filters the results.
webjars list
or mvn webjars:list
webjars list jquery
or mvn webjars:list -Dwebjar=jquery
Adds a webjar to your dependencies.
The required webjar
parameter specifies which WebJar to install. The format is: <name>[:<version]
. If there is no version, the latest version is used.
webjars install jquery
or mvn webjars:install -Dwebjar=jquery
webjars install jquery:1.10.1
or mvn webjars:install -Dwebjar=jquery:1.10.1
webjars-maven-plugin is licensed under the Apache v2.0 License.