1. 程式人生 > >自定義的樣式檔案和js檔案打成webjar

自定義的樣式檔案和js檔案打成webjar

1. 先把要打包成webjar的檔案放到你新建的maven結構的專案的/src/main/resources目錄下

2.編寫該專案的pom.xml檔案,如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
<modelVersion>4.0.0</modelVersion>  
<groupId>org.webjars</groupId>  
<artifactId>neris-pm-ui</artifactId>  
<version>0.0.1-SNAPSHOT</version>  
  
<name>neris-pm-ui</name>  
<url>http://maven.apache.org</url>  
  
<properties>  
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
    <destDir>${project.build.outputDirectory}/META-INF/resources/</destDir>  
</properties>  
  
<build>  
    <resources>  
        <resource>  
            <directory>${project.basedir}/src/main/resources</directory>  
            <targetPath>${destDir}</targetPath>  
        </resource>  
    </resources>  
</build>  
  
</project> 
3.執行打包命令即可:mvn clean package

來源:http://blog.csdn.net/sxdtzhaoxinguo/article/details/45666789