什么是WebJars?
WebJars are client-side web libraries (e.g. jQuery & Bootstrap) packaged into JAR (Java Archive) files.
WebJars是将客户端(浏览器)网络资源库(例如jQuery或者Bootstrap)打包成j的JAR文件
- Explicitly and easily manage the client-side dependencies in JVM-based web applications
- Use JVM-based build tools (e.g. Maven, Gradle, sbt, ...) to download your client-side dependencies
- Know which client-side dependencies you are using
- Transitive dependencies are automatically resolved and optionally loaded via RequireJS
- Deployed on Maven Central
- Public CDN, generously provided by: JSDELIVR
- 在基于JVM的网络应用程序中可以显式使用这些客户端依赖并且易于管理
- 可以通过基于JVM的构建工具(例如Maven、Gradle等)下载这些客户端依赖
- 可以清楚知道使用了哪些依赖
- 关联的依赖项会通过RequireJS自动确定和进行有选择的加载
- 这些客户端jar(依赖项)发布在Maven仓库中
- 也可以通过公用的内容分发网络获得,由JSDELIVER慷慨提供
Public CDN via jsDelivr
All of the WebJar contents are available on the public jsDelivr CDN. Just prefix //cdn.jsdelivr.net/webjars/{groupId}
in front of your static asset URLs. For instance, if using the org.webjars : jquery
WebJar and your local URL to jquery.js
is /webjars/jquery/2.1.0/jquery.js
then the CDN URL would be: //cdn.jsdelivr.net/webjars/org.webjars/jquery/2.1.0/jquery.js
网友评论