maven 动静态文件分离

pom 文件

  1. <plugin>  
  2.     <groupId>org.apache.maven.plugins</groupId>  
  3.     <artifactId>maven-assembly-plugin</artifactId>  
  4.     <version>2.2</version>  
  5.     <executions>  
  6.         <execution>  
  7.             <id>make-assembly</id>  
  8.             <phase>package</phase>  
  9.             <goals>  
  10.                 <goal>single</goal>  
  11.             </goals>  
  12.             <configuration>  
  13.                 <appendAssemblyId>false</appendAssemblyId>  
  14.                 <descriptors>  
  15.                     <descriptor>${basedir}/static-zip.xml</descriptor>  
  16.                 </descriptors>  
  17.             </configuration>  
  18.         </execution>  
  19.     </executions>  
  20. </plugin>  
  21. static-zip.xml 文件
  22. <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0">  
  23.     <id>project</id>  
  24.     <formats>  
  25.         <format>zip</format>  
  26.     </formats>  
  27.     <includeBaseDirectory>false</includeBaseDirectory>  
  28.     <fileSets>  
  29.         <fileSet>  
  30.             <directory>${basedir}/target/static/xxx</directory>  
  31.             <outputDirectory>project/pai</outputDirectory>  
  32.         </fileSet>  
  33.     </fileSets>  
  34. </assembly> 

猜你喜欢

转载自wpf-0604.iteye.com/blog/2358580