maven之打包靜態檔案

來源:互聯網
上載者:User

標籤:

將近太檔案進行zip打包,實現動靜分離 
pom.xml 

Xml代碼  
  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>  




static-zip.xml 

Xml代碼  
    1. <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">  
    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

maven之打包靜態檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.