The purpose of this is to put the front-end static files, CSS Ah js ah a bunch of put in a MAVEN project management, need to call the jar package direct reference.
1. Put the files you want to pack into another MAVEN project/src/main/resources
2, Write Pom.xml
1 <build>2 <resources>3 <resource>4 <directory>${ Project.basedir}/src/main/resources</directory>5 <targetpath>meta-inf/resources/</ Targetpath>6 </resource>7 </resources>8 </ Build>
3. Increase in SPRINGMVC configuration
<mvc:resources mapping= "/webjars/**" location= "classpath:/meta-inf/resources/webjars/" ></mvc:resources >
4. Call jar package in Project Pom file
5. View the display
A Web project that relies on the jar can be accessed through http://ip:port/[projectname]/webjars/jsname.js
6. Packing
Execute packaging command: MVN clean Package
After unpacking the package/resources/webjars/jsname.js
Maven Webjar Build and use