maven .assembly

配置文件中 配置好Assemblyc插件.

功能:打依赖jar包.

java代码如下:

  1. <assembly  
  2.     xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"  
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  4.     xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">  
  5.     <id>release</id>  
  6.     <formats>  
  7.         <format>zip</format>  
  8.     </formats>  
  9.     <fileSets>  
  10.         <fileSet>  
  11.             <directory>${project.basedir}\src\main\config</directory>  
  12.             <!-- 过滤 -->  
  13.             <excludes>  
  14.                 <exclude>*.xml</exclude>  
  15.             </excludes>  
  16.             <outputDirectory>\</outputDirectory>  
  17.         </fileSet>  
  18.     </fileSets>  
  19.       
  20.     <dependencySets>  
  21.         <dependencySet>  
  22.             <useProjectArtifact>true</useProjectArtifact>  
  23.             <outputDirectory>lib</outputDirectory><!-- 将scope为runtime的依赖包打包到lib目录下。 -->  
  24.             <scope>runtime</scope>  
  25.         </dependencySet>  
  26.     </dependencySets>  
  27. </assembly>  
原文地址:https://www.cnblogs.com/wayf/p/5970182.html