webjars入门
2018-09-09 本文已影响0人
宁好_8848

一、概念
WebJars是将客户端(浏览器)资源(JavaScript,Css等)打成jar包文件,以对资源进行统一依赖管理。WebJars的jar包部署在Maven中央仓库上。
二、如何使用webjars案例(bootstrap)
①引入依赖
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7-1</version>
</dependency>
②在前端网页上引入外部链接
<link rel="stylesheet" href="/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css"/>
三、常用的webjars
jquery,Bootstrap,npm,Swagger UI ,D3.js,Enbjs,Font Awesome等等
可参考该网站:https://www.webjars.org/