fantasy-java
我越發的感覺到你就是我生命中的精靈,翻轉跳躍在我那空虛的時空;有人說世界上最美的是春天和愛情,在我眼中有你的地方就是最美的。
BlogJava
首頁
新隨筆
聯系
聚合
管理
隨筆-95 評論-31 文章-10 trackbacks-0
maven三種打包插件
第一種:可執行jar與依賴分開,依賴在lib目錄里,需要jar和lib目錄在同級目錄,
優點:jar文件很小
缺點:需要放置lib文件夾在平級目錄
1
<
plugin
>
2
<
groupId
>
org.apache.maven.plugins
</
groupId
>
3
<
artifactId
>
maven
-
jar
-
plugin
</
artifactId
>
4
<
version
>
2.6
</
version
>
5
<
configuration
>
6
<
archive
>
7
<
manifest
>
8
<
addClasspath
>
true
</
addClasspath
>
9
<
classpathPrefix
>
lib
/</
classpathPrefix
>
10
<
mainClass
>
com.xxx.xxxService
</
mainClass
>
11
</
manifest
>
12
</
archive
>
13
</
configuration
>
14
</
plugin
>
15
<
plugin
>
16
<
groupId
>
org.apache.maven.plugins
</
groupId
>
17
<
artifactId
>
maven
-
dependency
-
plugin
</
artifactId
>
18
<
version
>
2.10
</
version
>
19
<
executions
>
20
<
execution
>
21
<
id
>
copy
-
dependencies
</
id
>
22
<
phase
>
package
</
phase
>
23
<
goals
>
24
<
goal
>
copy
-
dependencies
</
goal
>
25
</
goals
>
26
<
configuration
>
27
<
outputDirectory
>
$
{project.build.directory}
/
lib
</
outputDirectory
>
28
</
configuration
>
29
</
execution
>
30
</
executions
>
31
</
plugin
>
第二種:把所有依賴打進同一個jar包里。
缺點:jar文件會比較大,同時該插件有個bug會缺失spring的xds文件,導致無法運行jar,同時如果同級目錄還有其它可執行jar文件依賴可能會產生沖突
優點:方便快捷,打包完直接就能運行。
1
<
plugin
>
2
<
artifactId
>
maven
-
assembly
-
plugin
</
artifactId
>
3
<
configuration
>
4
<
descriptorRefs
>
5
<
descriptorRef
>
jar
-
with
-
dependencies
</
descriptorRef
>
6
</
descriptorRefs
>
7
<
archive
>
8
<
manifest
>
9
<
mainClass
>
com.xxx.xxxService
</
mainClass
>
10
</
manifest
>
11
</
archive
>
12
</
configuration
>
13
<
executions
>
14
<
execution
>
15
<
id
>
make
-
assembly
</
id
>
16
<
phase
>
package
</
phase
>
17
<
goals
>
18
<
goal
>
single
</
goal
>
19
</
goals
>
20
</
execution
>
21
</
executions
>
22
</
plugin
>
第三種:所有依賴打到同一個jar文件里。
缺點:jar文件過大、如果同級目錄有其它可執行jar,依賴可能會產生沖突
優點:不會有任何bug,直接打成可執行jar文件,最省事。
1
<
plugin
>
2
<
groupId
>
org.apache.maven.plugins
</
groupId
>
3
<
artifactId
>
maven
-
shade
-
plugin
</
artifactId
>
4
<
version
>
2.4
.
3
</
version
>
5
<
executions
>
6
<
execution
>
7
<
phase
>
package
</
phase
>
8
<
goals
>
9
<
goal
>
shade
</
goal
>
10
</
goals
>
11
<
configuration
>
12
<
filters
>
13
<
filter
>
14
<
artifact
>*
:
*</
artifact
>
15
<
excludes
>
16
<
exclude
>
META
-
INF
/**/
/*
.SF</exclude>
17
<exclude>META-INF/*.DSA</exclude>
18
<exclude>META-INF/*.RSA</exclude>
19
</excludes>
20
</filter>
21
</filters>
22
<transformers>
23
<transformer
24
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
25
<resource>META-INF/spring.handlers</resource>
26
</transformer>
27
<transformer
28
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
29
<resource>META-INF/spring.schemas</resource>
30
</transformer>
31
<transformer
32
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
33
<resource>META-INF/spring.tooling</resource>
34
</transformer>
35
<transformer
36
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
37
<mainClass>com.xxx.xxxInvoke</mainClass>
38
</transformer>
39
</transformers>
40
<minimizeJar>true</minimizeJar>
41
<shadedArtifactAttached>true</shadedArtifactAttached>
42
</configuration>
43
</execution>
44
</executions>
45
</plugin>
posted on 2017-05-03 10:08
朔望魔刃
閱讀(15135)
評論(0)
編輯
收藏
所屬分類:
java
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
Jdk和cglib動態代理
mybatis減少resultMap列映射
restful安全認證
spring-boot配置quartz
spring data jpa 小結
spring-boot data jpa 性能優化
spring-boot data jpa 復雜查詢
spring-boot-data-jpa nativeQuery 詳解
spring-boot data jpa
spring-boot 分頁小問題
<
2017年5月
>
日
一
二
三
四
五
六
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
常用鏈接
我的隨筆
我的文章
我的評論
我的參與
最新評論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
Android
flex(1)
git
gradle
IHE&DICOM&HL7的開源框架(1)
java(40)
JavaScript(2)
maven(1)
mybatis
netty(3)
python(3)
spring
svn(1)
即時通信(4)
各種整合
各種配置(9)
數據庫(2)
設計模式&&數據結構(11)
隨筆檔案
2018年8月 (1)
2018年3月 (1)
2018年1月 (1)
2017年12月 (3)
2017年11月 (6)
2017年10月 (1)
2017年8月 (2)
2017年7月 (1)
2017年6月 (1)
2017年5月 (1)
2017年2月 (1)
2016年12月 (3)
2016年10月 (1)
2016年9月 (2)
2015年12月 (1)
2015年7月 (2)
2015年5月 (1)
2015年2月 (3)
2015年1月 (1)
2014年12月 (2)
2014年7月 (1)
2014年5月 (4)
2014年3月 (1)
2013年9月 (6)
2013年8月 (1)
2013年7月 (3)
2013年4月 (1)
2012年7月 (2)
2012年6月 (4)
2012年5月 (2)
2012年1月 (1)
2011年12月 (2)
2011年11月 (2)
2011年9月 (1)
2011年6月 (1)
2011年5月 (1)
2011年3月 (4)
2011年2月 (2)
2010年12月 (2)
2010年9月 (9)
2010年8月 (4)
2010年4月 (1)
2010年3月 (1)
2010年1月 (2)
文章分類
文章(2)
生活(2)
英語學習(3)
詩歌(3)
文章檔案
2011年1月 (2)
2010年12月 (3)
2010年11月 (1)
2010年10月 (1)
2010年9月 (2)
2010年8月 (1)
收藏夾
技術文章(2)
娛樂博客
周德東
郭敬明
韓寒
鬼谷女
牛博
其實我是一個程序員
博客大巴~~
很牛的C++程序員
夢幻之旅
達內恩師
雪山飛鵠
高性能網站專家 淘寶 阿里架構師
搜索
最新評論
1.?re: jsp通過js按鈕導出word小結
下達
--q
2.?re: linux安裝mysql后root無法登錄
謝啦
--galo
3.?re: openfire_3.9.3集群配置
我這根本就不顯示hazelcast 這個插件包。請教下各位大神。
--openfre
4.?re: openfire_3.8.2集群配置[未登錄]
hazelcast-cache-config.xml 文件每一臺都要配4行ip嗎
--wp
5.?re: openfire_3.8.2集群配置
評論內容較長,點擊標題查看
--朔望魔刃
閱讀排行榜
1.?linux安裝mysql后root無法登錄(17840)
2.?maven三種打包插件(15135)
3.?openfire_3.8.2集群配置(9887)
4.?聯想y510p網卡設置(8591)
5.?swing日期控件(6848)
評論排行榜
1.?openfire_3.8.2集群配置(17)
2.?dcm4chee部署安裝(3)
3.?Java Service Wrapper工具把Java程序轉換為Windows服務小結(2)
4.?jsp通過js按鈕導出word小結(2)
5.?XML Schema<一>(1)
Powered by:
博客園
模板提供:
滬江博客
Copyright ©2025 朔望魔刃
主站蜘蛛池模板:
精品亚洲国产成人
|
日韩版码免费福利视频
|
免费黄色一级毛片
|
亚洲性色精品一区二区在线
|
精品一区二区三区免费毛片爱
|
亚洲精品国产美女久久久
|
两性色午夜免费视频
|
亚洲成av人影院
|
免费国产污网站在线观看15
|
亚洲精品中文字幕乱码
|
无码中文在线二区免费
|
亚洲av无码专区亚洲av不卡
|
国产成人免费永久播放视频平台
|
久久亚洲私人国产精品vA
|
97青青草原国产免费观看
|
亚洲不卡1卡2卡三卡2021麻豆
|
日韩视频在线精品视频免费观看
|
亚洲欧美国产精品专区久久
|
国产免费黄色大片
|
老司机精品免费视频
|
亚洲电影一区二区
|
欧美a级在线现免费观看
|
免费看一级高潮毛片
|
亚洲成AV人在线播放无码
|
一本无码人妻在中文字幕免费
|
色费女人18女人毛片免费视频
|
国产午夜亚洲精品国产成人小说
|
色欲色香天天天综合网站免费
|
中文有码亚洲制服av片
|
国产a v无码专区亚洲av
|
2015日韩永久免费视频播放
|
免费人成大片在线观看播放
|
国产AV无码专区亚洲Av
|
一级女人18毛片免费
|
一边摸一边爽一边叫床免费视频
|
亚洲一区二区影院
|
免费成人av电影
|
色播精品免费小视频
|
日亚毛片免费乱码不卡一区
|
亚洲欧洲日产国产最新
|
亚洲高清成人一区二区三区
|