你的位置:首页 > ASP.net教程

[ASP.net教程]maven之打包静态文件


将近太文件进行zip打包,实现动静分离 
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.</descriptor>  
  16.                 </descriptors>  
  17.             </configuration>  
  18.         </execution>  
  19.     </executions>  
  20. </plugin>  




static-zip.

    1. <assembly "http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" "http://www.w3.org/2001/xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0">  
    2.     <id>project</id>  
    3.     <formats>  
    4.         <format>zip</format>  
    5.     </formats>  
    6.     <includeBaseDirectory>false</includeBaseDirectory>  
    7.     <fileSets>  
    8.         <fileSet>  
    9.             <directory>${basedir}/target/static/xxx</directory>  
    10.             <outputDirectory>project/pai</outputDirectory>  
    11.         </fileSet>  
    12.     </fileSets>  
    13. </assembly>  

》》源码地址获取

springmvc + mybatis整合详细,及遇到的问题请参看以下资料:

参考资料:

http://www.springmvc,net/detail/6074493.html

http://my.spring.net/wangbiglei/blog/489583

http://my.springmvc.net/wangbiglei/blog/489604