首页 > 编程语言 > 详细

maven打包 依赖jar与不依赖jar

时间:2019-07-17 22:39:45      阅读:182      评论:0      收藏:0      [点我收藏+]

?
xml version="1.0" encoding="UTF-8"?> <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 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>jar-with-dependencies</id> <formats> <format>jar</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <unpack>false</unpack> <scope>runtime</scope> </dependencySet> </dependencySets> <fileSets> <fileSet> <directory>/lib</directory> </fileSet> </fileSets> </assembly>


 

     <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
 //上面为src.xml
<descriptors> <!--<descriptor>src/main/assembly/src.xml</descriptor>--> </descriptors> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <!-- this is used for inheritance merges --> <phase>package</phase> <!-- bind to the packaging phase --> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>

 我们可以设置jar包的作用域 进行胖包瘦包的选择,集群环境使用<scope>provide</scope>来选择是否需要将集群 jar打进去 ,或者只打第三方jar

maven打包 依赖jar与不依赖jar

原文:https://www.cnblogs.com/hejunhong/p/11203990.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!