100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > WebJars统一管理静态资源

WebJars统一管理静态资源

时间:2020-03-23 04:50:58

相关推荐

WebJars统一管理静态资源

推荐使用Webjars的三大理由:好用

使用教程------引入相关依赖:

首先在WebJars官网/WebJars - Web Libraries in Jars找到项目所需的依赖在pom引入 jQuery、BootStrap前端组件等。

发布私服-静态资源

静态资源pom-version版本号要与webjars一致。

配置 :POM

<dependency><!--Webjars版本定位工具--><groupId>org.webjars</groupId><artifactId>webjars-locator-core</artifactId></dependency><dependency><!--Jquery组件--><groupId>org.webjars</groupId><artifactId>jquery</artifactId><version>3.3.11</version></dependency>

修改:私服

<?xml version="1.0" encoding="UTF-8"?><project xmlns="/POM/4.0.0" xmlns:xsi="/2001/XMLSchema-instance"xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><!--项目信息--><groupId>org.webjars</groupId><artifactId>metronic</artifactId><version>5.2.5.RELEASE</version><packaging>jar</packaging><name>metronic</name><description>metronic</description><!--维护信息--><developers><developer><name>socks</name><email>/yizhiwazi</email></developer></developers><!--发布地址--><distributionManagement><repository><id>xx-repo</id><!--替换成公司私服地址--><url>http://127.0.0.1:8098/nexus/content/repositories/thirdparty/</url></repository><snapshotRepository><id>xx-plugin-repo</id><!--替换成公司私服地址--><url>http://127.0.0.1:8098/nexus/content/repositories/thirdparty/</url></snapshotRepository></distributionManagement></project>

配置:私服账号

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="/SETTINGS/1.0.0"xmlns:xsi="/2001/XMLSchema-instance"xsi:schemaLocation="/SETTINGS/1.0.0 /xsd/settings-1.0.0.xsd"><localRepository>D:repository</localRepository><mirrors><!-- 阿里云仓库 --><mirror><id>aliyun</id><mirrorOf>central</mirrorOf><name>aliyun-all</name><url>/nexus/content/groups/public/</url></mirror><!-- 中央仓库1 --><mirror><id>repo1</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>/maven2/</url></mirror><!-- 中央仓库2 --><mirror><id>repo2</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>/maven2/</url></mirror></mirrors> <!-- 暂时在发布仓库--><servers><!-- 仓库地址账号 --><server><id>xx-repo</id><username>admin</username><password>123456</password></server><!-- 插件地址账号 --><server><id>xx-plugin-repo</id><username>admin</username><password>123456</password></server></servers></settings>

maven->deploy。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。