Maven打成Webjar并使用的方法
1.编写pom.xml
<?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <groupId>com.asiainfo</groupId> <artifactId>edot-phone-app</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>edot-phone-app Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <destDir>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</destDir> </properties> <build> <resources> <resource> <directory>${project.basedir}/src/main/webapp</directory> <targetPath>${destDir}</targetPath> </resource> </resources> </build> </project>
2.执行命令deploy
3.applicationContext-mvc.xml
增加<mvc:resourcesmapping="/webjars/**"location="classpath:/META-INF/resources/webjars/"/>
参考博文:http://blog.csdn.net/sxdtzhaoxinguo/article/details/45666789
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01