链接地址:[Selecting Contents for Uber JAR](http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html)

apache网站在国内打开太慢了。因此我将这些有用的资源收集起来,保存在博客中!

Apache Maven Shade Plugin:是一个Maven打包的插件。其官网英文定义如下:This plugin provides the capability to package the artifact in an uber-jar, including its dependencies and to shade

001.

 1 <project>
 2   ...
 3   <build>
 4     <plugins>
 5       <plugin>
 6         <groupId>org.apache.maven.plugins</groupId>
 7         <artifactId>maven-shade-plugin</artifactId>
 8         <version>2.4.3</version>
 9         <executions>
10           <execution>
11             <phase>package</phase>
12             <goals>
13               <goal>shade</goal>
14             </goals>
15             <configuration>
16               <artifactSet>
17                 <excludes>
18                   <exclude>classworlds:classworlds</exclude>
19                   <exclude>junit:junit</exclude>
20                   <exclude>jmock:*</exclude>
21                   <exclude>*:xml-apis</exclude>
22                   <exclude>org.apache.maven:lib:tests</exclude>
23                   <exclude>log4j:log4j:jar:</exclude>
24                 </excludes>
25               </artifactSet>
26             </configuration>
27           </execution>
28         </executions>
29       </plugin>
30     </plugins>
31   </build>
32   ...
33 </project>
View Code

相关文章: