https://github.com/nidi3/use-webjars-maven-plugin
use webjars as if they would be npm modules
https://github.com/nidi3/use-webjars-maven-plugin
maven-plugin webjars
Last synced: 6 months ago
JSON representation
use webjars as if they would be npm modules
- Host: GitHub
- URL: https://github.com/nidi3/use-webjars-maven-plugin
- Owner: nidi3
- License: apache-2.0
- Created: 2017-01-18T13:07:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T10:47:33.000Z (over 8 years ago)
- Last Synced: 2025-02-13T12:41:37.048Z (8 months ago)
- Topics: maven-plugin, webjars
- Language: Java
- Size: 362 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# use-webjars-maven-plugin
Use webjars as if they would be npm modules.# Why?
[Webjars](http://www.webjars.org/documentation) work well in the JVM world.
But as soon as a project comes into contact with the javascript / npm / node.js
eco system, things start to get complicated.
There are mainly two reasons for that:- webjars basically are zip files. Therefore the contents is not directly available without unzipping.
- webjars encode their version in the directory structure. Therefore every tool processing them must configure somewhere the version number.This plugin treats webjars the same way as npm does with its modules:
- unpack the webjar
- strip the version from its pathThis way, tools like minifiers, css postprocessors, unit test runners etc. can be used with less hassle.
# Usage
The basic configuration looks like this:
````xml
guru.nidi.maven.plugins
use-webjars-maven-plugin
0.0.1
unpack
org.webjars
angularjs
1.5.7
````
Running `mvn package` results in this file structure:
````
src
...
target
webjars
META-INF
resources
webjars
angularjs
````# Configuration
The [plugin site](https://nidi3.github.io/use-webjars-maven-plugin/site/unpack-mojo.html) lists all options.
## Flatten
Adding
````true
````
omits `META-INF/resources/webjars` and results in
````
src
...
target
webjars
angularjs
````## Further settings
The plugin is based on [`maven-dependency-plugin:unpack-dependencies`](https://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo.html)
and supports all its settings.